Is it good practice to create a directory in
/dev/shm) and use that like a temp directory for an application?
Background: I am writing black box tests for a program which does a lot of stuff with files and directories. For every test I create a lot of files and directories and then run the program and then create the expected set of files and directories and then run diff to compare. I now have about 40 tests and they are already taking over 2 seconds to run. Hoping to speed things up I want to run the tests in a directory on some sort of ramdisk.
Researching about ram disk I stumbled upon a question with an answer stating that it is okay to create a directory in
/dev/shm and use that like a temp directory. Researching some more however I stumbled upon a wiki page from debian stating that it is an error to use
/dev/shm directly. I should use the
shm_* functions. Unfortunately the
shm_* functions seem to be not available for use in a shell script.
Now I am confused. Is it okay or not to use
/dev/shm) like a temp directory?