Appears possibly with mkfifo (this method makes it easy to manage, restart and large files)
$ mkfifo eternally_looping_filename
Then write that fifo is " looping " from one bash hint, for example: create a script called bash_write_eternal.sh:
while [ true ]; do cat /path/to/file_want_repeated > ./eternally_looping_filename done
run it in one terminal
$ ./bash_write_eternal.sh
(you can use it also if you want to reuse the same terminal)
then in another terminal run the input program, for example
$ ./my_program -input ./eternally_looping_filename
or
$ cat ./eternally_looping_filename | ./my_program
your program will now receive the eternal input of this file loop over and over. You can even “pause” the receiving program by interrupting the terminal on which the bash_write_eternal.sh script is running (its input will be suspended until you resume writing the fifo script).
Another advantage is the "resume" between calls, and also, if your program does not know how to get input from "stdin", it can get it from the file name here.
source share