Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Dec 5 '09 at 3:51

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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