Using 2.6.32 linux kernel, I need to use a specific filesystem on a block device partition and I wan’t to hook open/write/read/close (and few others) syscalls to read/write, in an other fashion that the specific filesystem, what should be written on this partition. It would be only for this partition, others partitions using this filesystem would act as usual. Fuse
Tag: filesystems
write(2)/read(2) atomicity between processes in linux
I have a case where there are two processes which act on the same file – one as a writer and one as a reader. The file is a one line text file and the writer re-writes the line in a loop. reader reads the line. The pseudo code looks like this: Writer Process Reader Process After a while of
Making a virtual file in Linux
I’m working with some existing software that I cannot change, and it loads its config data from a bunch of config files, all following the same naming scheme – let’s say, file_param1.conf, file_param2.conf, file_param3.conf etc. The difference between the content of the files is just param1 vs param2 vs param3, so a typical config file will look like or Is
Get list of files that contain given text within directory given by pattern
I want to get a list of files that contain a given text within my file-system. Furthermore only files should be considdered that are located in a directoy given by a pattern. So let´s say I have a number of directories called myDir within my filelsystem as shown here: Now I want to get all the files within those directories
find and remove all closed files that are not modified in some-time
I’m building a script in linux that will remove files from the disc that aren’t in used currently by the OS. I want to use find command so I can execute rm for all the files that I find that are not open. I tried so far this command without success: I found this command in some website it supposed
How do I create a file in FUSE in C?
For an assignment we have to build a FUSE file system using C. I am trying to create an empty file in the mountpoint directory that I have mounted when I start fuse but it’s not working. I tried placing the following inside my own implementation of the fuse init function: After I had done that, what happened when I
Can’t open /dev/sda2 exclusively. Mounted filesystem?
Above is my “fdisk -l”, my current problem is when I go and try to do “pvcreate /dev/sda2” it gives me “Can’t open /dev/sda2 exclusively. Mounted filesystem?” and I have been searching google for a while now trying to find a way to fix this. There is defiantly things I tried from google but none of them ended up working.
Adding content to middle of file..without reading it till the end
I have read various questions/answers here on unix.stackexchange on how to add or remove lines to/from a file without needing to create a temporary file. https://unix.stackexchange.com/questions/11067/is-there-a-way-to-modify-a-file-in-place?lq=1 It appears all these answers need one to atleast read till end of the file, which can be time consuming if input is a large file. Is there a way around this? I would
Physical disk block size on POSIX using C/C++
I’m working on a high performance I/O program and I’m trying to find the best way to determine the _physical_ (and not the _logical_) byte size of a device’s disk blocks with C++. My research so far has led me to the following code snippet: The man pages says the following about st_blksize: The st_blksize field gives the “preferred” blocksize
What is the proper place to put named pipes on Linux?
I’ve got a few processes that talk to each other through named pipes. Currently, I’m creating all my pipes locally, and keeping the applications in the same working directory. At some point, it’s assumed that these programs can (and will) be run from different directories. I need to create these pipes I’m using in a known location, so all of