Auto reload externally changed files does not work properly
Posted: Fri Feb 09, 2024 5:02 pm
Hi Gustaf,
The Flow CSV Viewer is a very simple and easy to use tool.
It features "Auto reload externally changed files: Immediately when detected", which I would like to use.
Unfortunately, this feature does not behave as expected. It works fine in some cases, but it does work in some other cases.
To be precise, I see two issues. When I run a script that does something like the following (pseudo code)
open_file "testfile.csv" "append"
for i=1 to 1000
write_file "$i;$i+1;$i*$i"
wait 100ms
next
close_file
then this script opens a file and appends a new line every 100ms, and this will be done for about 100 seconds (which is enough time to test the issue).
When I try to open testfile.csv with Flow then I get the error message "Load CSV: Could not open testfile.csv: Cannot access file testfile.csv because it is in use by another process". The same error message will occur when I change the script such that it writes to stdout and I redirect the output of the scipt with "> testfile.csv". This indicates that the file open command that is used in Flow does not accept opening a file that is simultaneously written by another process. Note that changing the script such that it embeds the write_file command between open_file and close_file seems to work better, but after a while Flow will get the same error because somewhen it will hit the short time window when the file is being written. Other tools can handle this, so I am sure there is a solution to this.
The second issue seems to related to the "Date created" and "Date accessed" information of a file (this info can be displayed in Windows Explorer).
From the idea point of view, "Date created" tells the date/time when the file is created (and this date normally is not expected to change as long as the file exists), whereas "Date accessed" tells the date/time when the file is accessed (e.g. when a line is appended). After some tests (with scripts / text editors / ...) I found that when "Date created" remains and "Date accessed" is updated (which intuitively is the expected behaviour when a file is continuously updated), Flow does NOT automatically update the waveform! But Flow does an automatic update in the case when "Date created" is updated (e.g. one of my text editors updates both "Date created" and "Date accessed" when I update and save a file)! I guess this should be simple to be fixed. All you need to do is to check for an update of "Date accessed" rather than "Date created".
Please put these issues on your list of improvements, and I hope you find the chance to fix this somewhen in the near future - because the way Flow behaves now is of limited use for me.
Regards,
Walter
The Flow CSV Viewer is a very simple and easy to use tool.
It features "Auto reload externally changed files: Immediately when detected", which I would like to use.
Unfortunately, this feature does not behave as expected. It works fine in some cases, but it does work in some other cases.
To be precise, I see two issues. When I run a script that does something like the following (pseudo code)
open_file "testfile.csv" "append"
for i=1 to 1000
write_file "$i;$i+1;$i*$i"
wait 100ms
next
close_file
then this script opens a file and appends a new line every 100ms, and this will be done for about 100 seconds (which is enough time to test the issue).
When I try to open testfile.csv with Flow then I get the error message "Load CSV: Could not open testfile.csv: Cannot access file testfile.csv because it is in use by another process". The same error message will occur when I change the script such that it writes to stdout and I redirect the output of the scipt with "> testfile.csv". This indicates that the file open command that is used in Flow does not accept opening a file that is simultaneously written by another process. Note that changing the script such that it embeds the write_file command between open_file and close_file seems to work better, but after a while Flow will get the same error because somewhen it will hit the short time window when the file is being written. Other tools can handle this, so I am sure there is a solution to this.
The second issue seems to related to the "Date created" and "Date accessed" information of a file (this info can be displayed in Windows Explorer).
From the idea point of view, "Date created" tells the date/time when the file is created (and this date normally is not expected to change as long as the file exists), whereas "Date accessed" tells the date/time when the file is accessed (e.g. when a line is appended). After some tests (with scripts / text editors / ...) I found that when "Date created" remains and "Date accessed" is updated (which intuitively is the expected behaviour when a file is continuously updated), Flow does NOT automatically update the waveform! But Flow does an automatic update in the case when "Date created" is updated (e.g. one of my text editors updates both "Date created" and "Date accessed" when I update and save a file)! I guess this should be simple to be fixed. All you need to do is to check for an update of "Date accessed" rather than "Date created".
Please put these issues on your list of improvements, and I hope you find the chance to fix this somewhen in the near future - because the way Flow behaves now is of limited use for me.
Regards,
Walter