Super User is a question and answer site for computer enthusiasts and power users. 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

Say I have files foo-a.wav, foo-b.wav and foo-c.wav on disk.

I have a piece of software whose interface allows me to enter the name of a single sound file; every time a certain feature of that software is activated it loads that file and plays it.

I want to play a random sound every time this feature is activated.

Is there some feature of the Unix filesystem that will let a file access for foo.wav return any of foo-a.wav, foo-b.wav or foo-c.wav at random?

share|improve this question
up vote 1 down vote accepted

No. The closest thing you could do would be to write a program to serve up a unix domain socket and change the content it serves each time a client connects.

share|improve this answer
...or a crontab entry to change it every minute, depending if it's allowable to have the same file repeat. – Nevin Williams May 22 '13 at 18:03
Or, a crontab entry that checks the file's access time every minute, and changes the symlink when it's been accessed. – Nevin Williams May 22 '13 at 18:44

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.