Skip to content

Conversation

@nealpatel-work
Copy link

I fixed a bug I encountered.

FileWatch tried to stat files located in directories without the +x flag. This caused FileWatch to raise an error (Errno::EACCES), which it shouldn't do (regardless of what permissions are set on the file).

@jsvd
Copy link
Collaborator

jsvd commented Feb 16, 2015

I agree that this is a poor error message, but not sure if adding the string "or stat" helps users understand that the problem comes from the directory's permissions.
maybe, on exception, check them?

begin
   # ...
rescue
   # ..
   dir = File.dirname("dir/file")
   unless File.executable?(dir) && File.writable?(dir) do
     @logger.error "Directory has permission issues #{File.stat(dir).inspect}"
   end
 end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants