I use File.WriteAllBytes to create a file "somefile.txt". Does it mean that when File.WriteAllBytes returns from execution the bytes passed to File.WriteAllBytes are actually on the disk? For example I write X amount of bytes with File.WriteAllBytes("somefile.txt", bytes) and then check the size of the file on the disk if the size equals the bytes.length. If it equals I assume the file was completely written to disk.
Say the bytes size is 1.5GB and on the machine it takes a while to write such amount; the disk where the file is written is a mapped network drive. Is it possible that File.WriteAllBytes returns from execution, but the OS is still writing bytes to the disk?