Here is what we are trying to accomplish:

  1. A client drops off a file on a Windows/Cygwin SFTP folder
  2. A Windows service scans the folder and processes the file

The problem:

  • The Windows service is getting a WinIOError when attempting to delete the file after processing. This is because the individual permissions on the file are set to read-only, despite the fact that the parent folder has permissions set to allow the Windows service full access to the content.

Any ideas on how we can set permissions on the file (either through code or through Cygwin) to allow full access to uploaded files?

  • i can't help but notice that if you use WinSCP along with something like NULL FTP Server, you dont need to write any code to accomplish what you are doing... do you really need to reinvent the wheel? – djangofan Dec 11 '09 at 0:28

In Cygwin you set permissions with the standard Unix tools. To give full access to everyone on a file you would use:

$ chmod 777 [filename]

See chmod manpage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.