title: How to unlock a file and delete it?
body: <p>I have a program that uploads files to a ftp server. If upload is complete then I delete the files. Occasionally the files are not deleted and because the upload is automated I get an infinite loop where 100 copies of the file reach the server. If I try to manually delete the file from explorer I'm able to do it but for some reason the Deletefile command from my app doesn't work.</p>
  
  <p>I've tried raising last OSError and I get nothing.</p>
  
  <p>The files are stored on a mapped drive. Is there any workaround? If I upload 30 files to a ftp server sometimes one or two files cannot be deleted after loading them to the server.</p>
  
  <p>Is there any way to close the file even if it is opened from another program? Something like unlocker does?</p>
  
  <p>How can i see if my application is locking the file? I haven't implemented any locking mechanism inside the app.</p>
  
  <p>Thanks.</p>