Question

IsolatedStorageFile.CopyFile() documents don't really say much about this, so I was wondering if the CopyFile() (and also DeleteFile() for that matter) method is an atomic action on the Isolated Storage?

Meaning, can I be sure that when the CopyFile() method returns and the execution leaves the Isolated Storage's using() block, the file has actually been copied to the flash memory? And I can in subsequent operations for example delete the original file(s)?

Was it helpful?

Solution

IsolatedStorageFile.CopyFile is synchronous: after executing this method, if no exception has been thrown, it means the file has been successfully copied. You can then safely delete the original file.

Note that you can directly use IsolatedStorageFile.MoveFile to do both operation (copying the file and deleting the original) at once.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top