Created
March 15, 2014 22:11
-
-
Save brandocorp/9574673 to your computer and use it in GitHub Desktop.
win32-file-stat test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> require 'win32/file' | |
=> true | |
irb(main):002:0> f = File::Stat.new('C:\Program Files') | |
=> #<File::Stat archive=false atime=2014-02-26 14:52:59 -0700 blksize=4096 blockdev=false blocks=1 compressed=false ctime=2009-07-13 20:20:08 -0700 dev=2 encrypted=false gid=2271478464 hidden=false indexed=true ino=281474976710716 mode=040555 mtime=2014-02-26 14:52:59 -0700 nlink=1 normal=false offline=false rdev=1478858236 readonly=true reparse_point=false size=4096 sparse=false system=false temporary=false uid=2271478464 | |
irb(main):003:0> f.directory? | |
=> true | |
irb(main):004:0> f.writable? | |
=> false | |
irb(main):008:0> f.send(:access_check, 'C:\Program Files', 0x40000000) # GENERIC_WRITE | |
=> true | |
irb(main):009:0> f.send(:access_check, 'C:\Program Files', 0x10000000) # GENERIC_ALL | |
=> false | |
irb(main):010:0> f.send(:access_check, 'C:\Program Files', 0x80000000) # GENERIC_READ | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment