Corsaair / redtamarin

AS3 running on the command line / server side
http://redtamarin.com
Other
119 stars 23 forks source link

FileSystem.createDirectory #131

Open tcorbet opened 5 years ago

tcorbet commented 5 years ago

I am unable to use FileSystem.createDirectory on a Windows 10 platform. I probably don't understand the code, but it appears to me that it will never succeed because, before you hit mkdir, you perform a stat on a filename that does not exist, which seems always to return an errno. I have confirmed that mkdir works, but the nice thing about createDirectory is that it ought to allow the creation of a full path with multiple sub-directories on a single invocation.

BTW: The CError properties available with this failure are of little help, mostly confusing, so thank you very much for the stack trace: errorID: 0 name: ENOTBLK message: No error

zwetan commented 5 years ago

it could be different things

probably a bug in the function itself, but could you provide the few lines of code to show how you were using it? could you provide the stacktrace?

it appears to me that it will never succeed because, before you hit mkdir, you perform a stat on a filename that does not exist, which seems always to return an errno.

yeah indeed isDirectory() call getFileMode() which use stat() in this particular case it cause an issue

isDirectory() should be wrapped in a try/catch and test for ENOENT error

well the FileSystem need more TLC and unit tests etc. for the time being as a workaround use your own implementation

we can not update yet in a timely fashion but those changes are coming

zwetan commented 5 years ago

TODO