When Explorer copies files around, it doesn’t really know what the maximum file size supported by any file system happens to be. (That information is not reported by GetVolumeInformation
.) So it guesses.
If the file system name is "FAT"
or "FAT32"
, then Explorer assumes that the maximum file size is 4GB − 1.
Also, if a file operation fails with the error ERROR_INVALID_PARAMETER
, and Explorer can’t figure out why the parameter is invalid, it assumes that the reason is that the file has exceeded the maximum allowed file size.
Why does Explorer map “invalid parameter” to “file size too large”? Because some file systems use ERROR_INVALID_PARAMETER
to report that a file is too large instead of the somewhat more obvious ERROR_FILE_TOO_LARGE
.
Therefore, if you’re implementing a file system, and you’re getting these spurious “File too large” errors, one thing to check is whether you are reporting “invalid parameter” for a case where all the parameters are actually valid, but something else prevents you from doing what you want. (Maybe “access denied” would be a better error code.)
0 comments