Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is no way to know if a file move or copy will guaranteed succeed or not.</p> <p>But you can check quite a few things to see if it will fail:</p> <ul> <li>Check for disk space at the destination location (you need at least the size of your file)</li> <li>Check for a file that already exists at the destination location</li> <li>Do a file open, requesting read access on the source file to make sure 1) you have permissions to it, 2) it is not in use.</li> <li>You can read the entire source file to make sure there are no locks inside the file. </li> <li>A trick used by windows explorer when copying files (or moving across volumes) is to first create a blank file, then to extend the file to the full size. Only after the file is fully allocated, then writes start to happen into the file. </li> <li>Allocating a file the size of the data you want to copy over will also tell you if there is a filesystem quote in place as well that has been reached. </li> <li>If a file is in use, and you want to go this far, you could use Volume Shadow Copy (VSS).</li> </ul> <p><strong>More on file locking:</strong></p> <p>Please see my answer here for much more information on <a href="https://stackoverflow.com/questions/575328/fcntl-lockf-which-is-better-to-use-for-file-locking/575349#575349">file locking &amp; permissions in linux</a>.</p> <p>Please see my answer here for much more information on <a href="https://stackoverflow.com/questions/203837/can-i-simply-read-a-file-that-is-in-use/203839#203839">file locking &amp; permissions in Windows</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload