Is there any way to create a virtual file, such that reading from the file actually reads from the stdout of a command; writing to the file is acually writing to the stdin of a command?
So far I have kludged this with an inotifywait on a file, which calls a command when the file is modified, taking it's input from the file and writing back to it.
I don't like that the inotifywait has to be const
I would like to create a special file similar to /dev/null or /dev/random, where the file doesn't actually exist but you can read from it all the same, except that I could actually set a cap on the apparent size of the file.
To put it another way, I want to create a special file where (assuming I set the cap at 500gb) when I "cat" the file it will output all 500gb of the file and then stop.
I'm running a live distro in ram. I need to write a password to a file. Later, I need to delete it securely.
I don't know how live file systems work, so I'm unsure if I open the file for writing, then write over it with data the length of the password, if it actually will write over that exact memory location or not.
I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command
gzip file.txt
results in modifying this file and renaming it file.txt.gz. instead of this behavior I would like to have this new compressed file in addition to the existing one file.txt.
In Linux file system, there are files such as /dev/zero and /dev/random which are not real files on hard disk.
Is there any way that we can create a similar file and tell it to get ouput from executing a program?
For example, can I create file, say /tmp/tarfile, such that any program reading it actually gets the output from the execution of a different program (/usr/bin/tar ...)?
I installed sarg from sarg rpm and i am facing issue while generating sarg reports and getting this time different error below
sarg -l /var/log/squid/access.log
SARG: Records in file: 242332, reading: 0.00%
SARG: Records in file: 242332, reading: 2.06%
SARG: Records in file: 242332, reading: 4.13%
SARG: Records in file: 242332, reading: 6.19%
Hi,
For one of the project which i am working on i need to write a cpp code such that it will create the structure dynamically instead of reading it from header file.
For example we have a program which is reading a binary file according to the structure mentioned in header file.
But we want to make the program to generic to support reading of binary file of any structure that we pass to it
Lets say I wanted to create a .txt file that had some commands in it.
Then from .txt file the contents are extracted to the terminal.
Is this even possible and does it have to be a .txt file? oh and I am running 12.04
I want to create a file system monitor which will notify whenever a change is made to any file on the file system, especially a write, new file creation or rename.
I have done research, and found stuff like FindFirstChangeNotification function, pyinotify
How to access the log and use it to do the above?
Any file change will be then used by the software for further calculations, how to go about?