Folder Write Permissions?
Page 1 of 1

Author:  thedevilsjester [ Mon Mar 31, 2008 6:22 pm ]
Post subject:  Folder Write Permissions?

I need to determine if the current user has write permissions to a specific folder.

I can get the human readable, or the octal file permissions but this doesnt give me what I need, and it would take a lot of code to use these values to determine if this specific user is the owner, part of the writeable group, etc...

Is there a better way to check for write permissions?

Author:  DarthWavy [ Tue Apr 01, 2008 2:42 am ]
Post subject: 

if [ -w './path/to/folder' ]
  echo 'yay i can write'

Check 'man test' :)

Author:  thedevilsjester [ Tue Apr 01, 2008 3:09 am ]
Post subject: 

Thank you.

All that I know of bash scripting is from google and looking at other scripts and its been difficult to try and find this solution, I may have even encountered it before; however the syntax really doesnt explain what it does (to one not experienced with bash scripting) so I probably just glanced right over it, not knowing what it was.

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group •