Here is the gist: https://gist.github.com/973e70bde8e6a530c489
I have two scenarios. One works, and one fails, although the code is exactly the same.
- Take the CSV file already in the field and analyze it. Works great. No problems.
- Take the CSV file that was just created and try to parse it, and I get:
ENOENT, there is no such file or directory '/Users/Home/dev/csv/TwFrI5vhdownload.csv
Same CSV file format and all that. It does not matter, since the created file does not even open. It does not work with the error above, although the file exists. If I restart Node and try to capture this file, then it works fine. If I run fs.stat in a newly created file, this will not work.I tried timeouts, external callbacks, etc., but with a dynamically created file, it always fails.
What am I missing here? Is the file locked and I donβt know it?
Thank!
System:
OSX Lion Node v0.6.7
source
share