ffi-stat 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75578daf5dd9e3def32adfd97911183fd408b0fc
4
- data.tar.gz: d00f4b82dc49410d44f09fd9875ffe0573148f63
3
+ metadata.gz: 07ec3609c946c5891c15935a0af26910937a22d4
4
+ data.tar.gz: 8cad04f5ea5b3e5867ee7d707b7e7a5f35350eae
5
5
  SHA512:
6
- metadata.gz: cb571d9904734efc83355fb4f9f40dcea233f3628bc1b921675da2e18addbee03ec15cefa59c9c99e909d65a8258325968616ef46db9473f08738a23201de02f
7
- data.tar.gz: 7a6f5f8486c2113280e509a9183d99737a6d193974a7b2aef55b4166ab77b229b47e807144be472448708c2a9bdce431fa43a3600b87803524b3e0ad023939d2
6
+ metadata.gz: 404391d1fc2ee0d4bd797f44e2b5217b0d9fe140dee8b11c6f67d9a999a742f82eff1c6430108338e23b2726582a9a433ed0c5bce9bc5fcb0e66e19072bbc1db
7
+ data.tar.gz: ab1c037019a49a08e21da14739414d8c1bd3568af141ce9aa1dc538e86ce6d95fbc151f2d728fc1da594e853a039ceb349d9c752ad7aeb6a6ed14868e70c0325
data/ffi-stat.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "ffi-stat"
7
- spec.version = "0.2.0"
7
+ spec.version = "0.3.0"
8
8
  spec.authors = ["Adam Tanner"]
9
9
  spec.email = ["adam@adamtanner.org"]
10
10
  spec.description = %q{ Ruby FFI bindings for stat }
@@ -32,6 +32,40 @@ module FFI::Stat
32
32
  :st_gen, :uint32
33
33
  end
34
34
 
35
+ # File types.
36
+ S_IFMT = 0x170000
37
+ S_IFIFO = 0x010000
38
+ S_IFCHR = 0x020000
39
+ S_IFDIR = 0x040000
40
+ S_IFBLK = 0x060000
41
+ S_IFREG = 0x100000
42
+ S_IFLNK = 0x120000
43
+ S_IFSOCK = 0x140000
44
+
45
+ # File modes.
46
+
47
+ # Read, write, execute by owner.
48
+ S_IRWXU = 0x000700
49
+ S_IRUSR = 0x000400
50
+ S_IWUSR = 0x000200
51
+ S_IXUSR = 0x000100
52
+
53
+ # Read, write, execute by group.
54
+ S_IRWXG = 0x000070
55
+ S_IRGRP = 0x000040
56
+ S_IWGRP = 0x000020
57
+ S_IXGRP = 0x000010
58
+
59
+ # Read, write, execute by others.
60
+ S_IRWXO = 0x000007
61
+ S_IROTH = 0x000004
62
+ S_IWOTH = 0x000002
63
+ S_IXOTH = 0x000001
64
+
65
+ S_ISUID = 0x004000
66
+ S_ISGID = 0x002000
67
+ S_ISVTX = 0x001000
68
+
35
69
  def self.stat(path)
36
70
  stat = FFI::Stat::Stat.new
37
71
 
@@ -20,4 +20,38 @@ module FFI::Stat
20
20
  :st_mtimespec, FFI::Stat::Timespec,
21
21
  :st_ctimespec, FFI::Stat::Timespec
22
22
  end
23
+
24
+ # File types.
25
+ S_IFMT = 0x170000
26
+ S_IFIFO = 0x010000
27
+ S_IFCHR = 0x020000
28
+ S_IFDIR = 0x040000
29
+ S_IFBLK = 0x060000
30
+ S_IFREG = 0x100000
31
+ S_IFLNK = 0x120000
32
+ S_IFSOCK = 0x140000
33
+
34
+ # File modes.
35
+
36
+ # Read, write, execute by owner.
37
+ S_IRWXU = 0x000700
38
+ S_IRUSR = 0x000400
39
+ S_IWUSR = 0x000200
40
+ S_IXUSR = 0x000100
41
+
42
+ # Read, write, execute by group.
43
+ S_IRWXG = 0x000070
44
+ S_IRGRP = 0x000040
45
+ S_IWGRP = 0x000020
46
+ S_IXGRP = 0x000010
47
+
48
+ # Read, write, execute by others.
49
+ S_IRWXO = 0x000007
50
+ S_IROTH = 0x000004
51
+ S_IWOTH = 0x000002
52
+ S_IXOTH = 0x000001
53
+
54
+ S_ISUID = 0x004000
55
+ S_ISGID = 0x002000
56
+ S_ISVTX = 0x001000
23
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Tanner