File Exists But Receiving ENOENT Error

859 views
Skip to first unread message

Brandon Hall

unread,
Jan 26, 2012, 12:33:28 AM1/26/12
to nod...@googlegroups.com
Please let me know if more details or code is needed:

I have two scenarios. One works and one fails even though the code is exactly the same.

1) Take a CSV file already on the box and parse it. Works perfectly. No issues perfectly.
2) Take a CSV file that was just created and attempt to parse it and I receive: ENOENT, no such file or directory '/Users/Home/dev/csv/TwFrI5vhdownload.csv

Same CSV file format and all that. Wouldn't matter anyway because the created file won't even open. It fails with the error above even though the file does exist. If I restart Node and attempt to grab that file, then it works perfectly. If I run fs.stat on the newly created file it fails.

I've tried timeouts, external callbacks, etc.. but with the dynamically created file it always fails.

What am I missing here? Is the file locked and I don't know it?

Thanks!

System:

OSX Lion
Node v0.6.7

Brandon Hall

unread,
Jan 26, 2012, 11:30:13 AM1/26/12
to nod...@googlegroups.com
Here is a code example:

The CSV file is clearly in that directory, but it still throws the ENOENT error. If I restart node and attempt to pull that file it executes without an issue.

I'm using CasperJS to grab the file which puts it in the directory. This part returns the filename: console.log('Here: ' + filename); and it works. But, if I try to run fs.stat the file isn't found. I've tried running fs.fchmodSync but it says the file doesn't exist even though it is clearly there.

Any ideas here because I'm stuck?

Thanks for any help!


FELIPE TORRES

unread,
Nov 5, 2013, 8:58:34 PM11/5/13
to nod...@googlegroups.com
Managed to solve it?
I'm stuck in the same place, i cannot modify an image i just uploaded.
Reply all
Reply to author
Forward
0 new messages