You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, all information of the FileSystemEntry is retrieved as part of the enumeration syscall.
On Unix, some of the properties are retrieved by making additional stat calls.
This means the Unix implementation needs to handle the case where the item may be deleted after it was reported by the readdir syscall, and before the stat syscall was made to get the additional properties.
For Windows compatibility, the Unix implementation does not throw for errors on the stat call.
These are some issues with the implementation:
continueOnError should be used on all calls that retrieve info FileStatus to avoid the exception getting thrown.
When the item no longer exists, Attributes should return a value based on the information of the dirent_t. The FileAttributesAreExpected and DirectoryAttributesAreExpected that check for this have a bug which causes them to report a false positive due to performing a stat call when checking to remove FileAttributes.Hidden.
The FileStatus gets reused across the enumeration. GetLength is missing a check to ensure the status is initialized that can cause information from the previous entry to leak into the next when the latter can not be initialized.
Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.
Issue Details
On Windows, all information of the FileSystemEntry is retrieved as part of the enumeration syscall.
On Unix, some of the properties are retrieved by making additional stat calls.
This means the Unix implementation needs to handle the case where the item may be deleted after it was reported by the readdir syscall, and before the stat syscall was made to get the additional properties.
For Windows compatibility, the Unix implementation does not throw for errors on the stat call.
These are some issues with the implementation:
continueOnError should be used on all calls that retrieve info FileStatus to avoid the exception getting thrown.
When the item no longer exists, Attributes should return a value based on the information of the dirent_t. The FileAttributesAreExpected and DirectoryAttributesAreExpected that check for this have a bug which causes them to report a false positive due to performing a stat call when checking to remove FileAttributes.Hidden.
The FileStatus gets reused across the enumeration. GetLength is missing a check to ensure the status is initialized that can cause information from the previous entry to leak into the next when the latter can not be initialized.
On Windows, all information of the
FileSystemEntry
is retrieved as part of the enumeration syscall.On Unix, some of the properties are retrieved by making additional
stat
calls.This means the Unix implementation needs to handle the case where the item may be deleted after it was reported by the readdir syscall, and before the stat syscall was made to get the additional properties.
For Windows compatibility, the Unix implementation does not throw for errors on the
stat
call.These are some issues with the implementation:
continueOnError
should be used on all calls that retrieve infoFileStatus
to avoid the exception getting thrown.Attributes
should return a value based on the information of thedirent_t
. TheFileAttributesAreExpected
andDirectoryAttributesAreExpected
that check for this have a bug which causes them to report a false positive due to performing astat
call when checking to removeFileAttributes.Hidden
.FileStatus
gets reused across the enumeration.GetLength
is missing a check to ensure the status is initialized that can cause information from the previous entry to leak into the next when the latter can not be initialized.cc @carlossanlop
The text was updated successfully, but these errors were encountered: