I use Ruby and must determine if I can write a directory before trying to create new files.
I tried the following code that correctly returns true / false depending on whether @path is a directory. However, it still returns true when there is no write permission to the @path folder.
if File.directory?(@path) && File.writable?(@path)
I have looked at the help for the File and Dir classes and do not see any method that allows me to check write permissions to the directory. Is there any way?
I need it to work on Windows using Ruby 1.9.3.
Simonmayer
source share