Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ private static unsafe void Preallocate(string fullPath, long preallocationSize,
{
int errorCode = Marshal.GetLastPInvokeError();

// Only throw for errors that indicate there is not enough space.
// SetFileInformationByHandle fails with ERROR_DISK_FULL in certain cases when the size is disallowed by filesystem,
// such as >4GB on FAT32 volume. We cannot distinguish them currently.
// Only throw for errors that indicate there is not enough space or the file is too large.
// SetFileInformationByHandle fails with ERROR_DISK_FULL when the size is disallowed by filesystem,
// such as >4GB on a FAT32 volume, and with ERROR_INVALID_PARAMETER on NTFS when the requested
// allocation size exceeds the maximum file size supported by the filesystem or volume configuration.
if (errorCode is Interop.Errors.ERROR_DISK_FULL or
Interop.Errors.ERROR_FILE_TOO_LARGE or
Interop.Errors.ERROR_INVALID_PARAMETER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public void PreallocationSize(FileAccess access, FileMode mode)
}
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/92624", TestPlatforms.Windows)]
// macOS fcntl doc does not mention ENOSPC error: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
// But depending on the OS version, it might actually return it.
// Since we don't want to have unstable tests, it's better to not run it on macOS at all.
Expand Down
Loading