Re: dir() error
- Posted by jimcbrown (admin) Jul 06, 2013
- 1371 views
Is calling a .zip file a dir a random thing in Euphoria?
No. It only seems to happen for directory names that end with ".zip".
I believe this is actually a Windoze bug.
From http://msdn.microsoft.com/en-us/library/aa364428(v=vs.85).aspx
Note In rare cases or on a heavily loaded system, file attribute information on NTFS file systems may not be current at the time this function is called. To be assured of getting the current NTFS file system file attributes, call the GetFileInformationByHandle function.
Likewise, from http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx
If you are writing a 32-bit application to list all the files in a directory and the application may be run on a 64-bit computer, you should call the Wow64DisableWow64FsRedirectionfunction before calling FindFirstFile and call Wow64RevertWow64FsRedirection after the last call to FindNextFile. For more information, see File System Redirector.
Basically, there seem to be a number of reasons beyond our control why our Windoze dir() implementation would fail to get an accurate snapshot of a file or the contents of a directory.
What does the Microsoft 'dir' command say about that entry?
A good (nay, required) test, but that command may do things differently behind the scenes/under the hood - so a Windoze bug that affects dir() may not affect 'dir', or vice versa.