Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with times-series file naming when writing files in quick succession #50

Open
julienbesle opened this issue Jan 16, 2017 · 1 comment

Comments

@julienbesle
Copy link
Contributor

Hello,

I just came across a problem with how mrTools names time-series files it creates. I wrote an mrLoadRet analysis that separates interleaved frames and writes them to two separate files. The problem arose because the files get written quite fast after one another and some end up being written with the same file name as the preceding one (because the filename is a timestamp in seconds) and overwrites it.
I fixed this in my analysis function by adding a on-second pause between files, but I think there should be a more general fix at a more basic level (for isntance by adding a millisecond timestamp, or by forcing a one-second pause in saveNewTSeries.m?).
I don't have time to do it now, but I can look into it when I get a chance. I just thought I'd share the issue so it doesn't happen to others.

@justingardner
Copy link
Owner

Interesting - hadn't considered saving files that quickly :) One possibility would be have it generate the timestamp name - validate whether that exists or not, if it does exist, append msec's and check again until name becomes unique - would probably be preferable not to always append msec so that names don't get too long...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants