Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Short of writing a driver, is it possible to create a file in Linux with dynamic contents?

Suppose I had the files

a.txt:

foo

b.txt:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

bar

And a program whose source I don’t control that reads a given file from a path, is there a path I can give it that would result in it reading

foo
bar

as if it had called cat a.txt b.txt?

Additionally, suppose I changed an input file as such

b.txt:

baz

I would like the program, should it read again, to now read

foo
baz

I’m aware I could use something like a makefile to generate such a file, but that would involve running make every time any of the input files changed for no other benefit.

>Solution :

I think you’re hoping that, whatever is contained in a.txt and b.txt, the application could read c.txt and receive the contents of both files. That cannot be done passively. You need some process, somewhere, to do the combining. An active process could write to a named pipe, but that’s not "permanent".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading