Skip to content

Instantly share code, notes, and snippets.

@natewalck
Created September 29, 2012 15:43
Show Gist options
  • Save natewalck/3804401 to your computer and use it in GitHub Desktop.
Save natewalck/3804401 to your computer and use it in GitHub Desktop.
Even more of a dirty hack for Ruby World-writable test (1.8.7)
def world_writable?(file)
write_bit = Integer(sprintf("%o", File.stat(file).mode)[-1,1])
puts write_bit
if [2, 3, 6, 7].include?(write_bit)
true
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment