Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a command line program that is expecting to be passed a configuration file e.g.

sphinx --config /some/config_file

I'm calling this command from inside a ruby program where I'm currently dynamically generating the config file before writing it to disk, this seems like a waste as the file is only every used once and just deleted again straight after.

I was wondering if there's a way to avoid writing the file to disk and just passing in something that the program will think is a file but really hasn't been written to disk?

share|improve this question
This largely depends on what command line options sphinx makes available. Many unix-y utilities are able to accept input via STDIN, but I'm not sure if that's the case with this utility. If anything, you could just make a very small ramdisk and write the file there. That would be very fast. – EEAA May 2 '12 at 3:03

Depending on how your program reads the file, you might be able to use a named pipe, but it's very likely that it won't work; named pipes are not random access.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.