Failed File.Copy attempt to FAT and FAT 32 file systems makes the target file empty

76 Views Asked by At

If the file is located in the NTFS file system, everything seems to be fine. However, if the file is located on FAT or FAT32 file system, file's content is getting erased and it becomes a 0KB file after File.Copy.

File.Copy(biggerFile, smallerFile, true);

The issue happens when there is no enough space on the "smallerFile"s drive and File.Copy operation fails with IOException.

Is this something that is expected, because I can't find this behavior documented anywhere?

0

There are 0 best solutions below