Hi everyone and thanks a lot for your work!

I'm trying to adapt the cookbook example "Dump a stream into segmented
files".
I'd like to have the filename containing the unix timestamp (or epoch),
but I don't know what are the possibles "time literals" mentioned in the
cookbook:
https://www.liquidsoap.info/doc-2.1.4/cookbook.html#dump-a-stream-into-segmented-files

What I'm trying to achieve looks like this:
output.file(%mp3, '/archive/%s.mp3', s, reopen_when={0m})
Where %s would be replaced by the unix timestamp (%s taken from the date
command) but unfortunately, %s is not a "time literal". Plus, I can't find any
definition or list of "time literals" anywhere in the doc or in the
source code.

I managed to get the unix timestamp in my filename with:
output.file(%mp3, '/archive/#{int_of_float(gettimeofday())}.mp3', s, 
reopen_when={0m})
But the time is evaluated at the string creation and not a each file
opening.

Is it possible for you to document the "time literals"?
Where can I find this list? And where can I add some new literals if
needed?

Thank you for your time,
Niilos


_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to