0

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?

1
  • 2
    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, 2012 at 3:03

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .