win32-file-stat 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +154 -148
- data/MANIFEST +10 -10
- data/README +94 -93
- data/Rakefile +31 -31
- data/lib/win32/file/stat.rb +994 -984
- data/lib/win32/file/windows/constants.rb +94 -94
- data/lib/win32/file/windows/functions.rb +68 -67
- data/lib/win32/file/windows/helper.rb +13 -13
- data/lib/win32/file/windows/structs.rb +190 -190
- data/test/test_file_stat.rb +677 -677
- data/win32-file-stat.gemspec +27 -27
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3840cb754937cf959eec54d9b3e3bbef118f548
|
4
|
+
data.tar.gz: 1459708b0e2ff8d1fd7f1e1989b36059abe2c97c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5214572035217bd130c4076e81e9ece7dde302ac940c8f3be38ac0a83118e656a6909e9a806259c922f67f4f22862a8e1f7cf482452eba9225a4ba86fd93dc3a
|
7
|
+
data.tar.gz: 150f3c2757be969aa5e01181590e1cf49e79608069e838a098d7d13283dabc85c724d9d5fe88f018d16a29657ecef4b7d3e2f7126d5c6f2cf7016f30ced6e805
|
data/CHANGES
CHANGED
@@ -1,148 +1,154 @@
|
|
1
|
-
== 1.5.
|
2
|
-
*
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
*
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
*
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
*
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
*
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
*
|
32
|
-
* The #
|
33
|
-
* The #
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
* The #
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
*
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
*
|
48
|
-
|
49
|
-
|
50
|
-
*
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
== 1.3.
|
56
|
-
*
|
57
|
-
*
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
*
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
*
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
*
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
*
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
*
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
*
|
96
|
-
*
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
*
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
*
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
*
|
116
|
-
|
117
|
-
== 1.2.
|
118
|
-
*
|
119
|
-
|
120
|
-
== 1.2.
|
121
|
-
*
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
* Added
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
1
|
+
== 1.5.2 - 9-Jul-2015
|
2
|
+
* A working File::Stat#socket? method is now implemented. It is no longer
|
3
|
+
just an alias for the File::Stat#pipe? method.
|
4
|
+
* Fixed a bug in File::Stat#file? where it could return true for directories and
|
5
|
+
reparse points. Thanks go to zinga666 for the spot.
|
6
|
+
|
7
|
+
== 1.5.1 - 8-Dec-2014
|
8
|
+
* Added code to work around 64-bit JRuby bug.
|
9
|
+
* Some minor refactoring for the get_current_process_sid method.
|
10
|
+
|
11
|
+
== 1.5.0 - 10-Nov-2014
|
12
|
+
* Added the #streams method, which shows alt streams for the file.
|
13
|
+
* Use require_relative where appropriate.
|
14
|
+
* Removed reference to rubyforge_project in gemspec.
|
15
|
+
|
16
|
+
== 1.4.3 - 8-May-2014
|
17
|
+
* The #writable? method now ignores the readonly attribute if it's a directory.
|
18
|
+
* Replaced File.exists? with File.exist? to avoid warnings in Ruby 2.1.x.
|
19
|
+
|
20
|
+
== 1.4.2 - 28-Apr-2014
|
21
|
+
* Allow the File::Stat.new method to accept objects that respond to to_str
|
22
|
+
or to_path to mimic MRI.
|
23
|
+
|
24
|
+
== 1.4.1 - 12-Feb-2014
|
25
|
+
* The #writable? and #writable_real? methods now always return false if the
|
26
|
+
file has been marked readonly.
|
27
|
+
* Fixed an rdev test and added a writable test.
|
28
|
+
|
29
|
+
== 1.4.0 - 16-Dec-2013
|
30
|
+
* Conversion to FFI.
|
31
|
+
* Now requires Ruby 1.9 or later.
|
32
|
+
* The #mode method now more closely matches core MRI.
|
33
|
+
* The #executable? method now simply checks the extension name. The Windows
|
34
|
+
API method I was using before (GetBinaryType) was limited to .exe files and
|
35
|
+
could return false positives. The current version checks for .bat, .cmd,
|
36
|
+
.com and .exe.
|
37
|
+
* The #dev method returns the volume serial number instead of a drive letter.
|
38
|
+
* The #symlink? method was implemented.
|
39
|
+
* The #uid method was implemented. It now returns an actual user id. It can
|
40
|
+
optionally be passed a boolean argument. If true, it will return the full
|
41
|
+
string SID.
|
42
|
+
* The #owned? method was implemented.
|
43
|
+
* The #gid method was implemented. It now returns an actual group id. It can
|
44
|
+
optionally be passed a boolean argument. If true, it will return the full
|
45
|
+
string SID.
|
46
|
+
* The #grpowned? method was implemented.
|
47
|
+
* The #ino method was implemented.
|
48
|
+
* Added working implementations of the #readable?, #writable?,
|
49
|
+
#world_readable? and #world_writable? methods.
|
50
|
+
* The VERSION constant was changed to WIN32_FILE_STAT_VERSION.
|
51
|
+
|
52
|
+
== 1.3.6 - 24-Mar-2012
|
53
|
+
* Eliminated some warnings for Ruby 1.9.3.
|
54
|
+
|
55
|
+
== 1.3.5 - 21-Nov-2011
|
56
|
+
* Fixed a bug in the dev method for 1.9.x.
|
57
|
+
* Fixed some method redefinition warnings.
|
58
|
+
* Refactored the Rakefile and gemspec. The old install task has been
|
59
|
+
removed from the Rakefile.
|
60
|
+
|
61
|
+
== 1.3.4 - 13-Aug-2009
|
62
|
+
* Changed license to Artistic 2.0.
|
63
|
+
* Some gemspec updates, including the addition of a license, an updated
|
64
|
+
description, and changing test-unit from a runtime dependency to a
|
65
|
+
development dependency.
|
66
|
+
* Some documentation updates, mostly to make certain things invisible that
|
67
|
+
aren't meant for public consumption.
|
68
|
+
* One test now skipped on 64-bit versions of Windows.
|
69
|
+
|
70
|
+
== 1.3.3 - 9-Feb-2009
|
71
|
+
* Fixed a bug where File::Stat.new failed on locked files. Thanks go to
|
72
|
+
Montgomery Kosma for the spot.
|
73
|
+
* Now requires windows-pr 1.0.0 or later.
|
74
|
+
* Updated the README to note that 32 bit versions of Ruby which attempt
|
75
|
+
to access locked system files on 64 bit versions of MS Windows will fail.
|
76
|
+
|
77
|
+
== 1.3.2 - 1-Oct-2008
|
78
|
+
* Fixed an issue with the private get_blksize method.
|
79
|
+
* Updated the test suite to use Test::Unit 2.x, which also makes it a
|
80
|
+
required dependency.
|
81
|
+
* Removed the pre-generated .txt and .exe files that were used for testing.
|
82
|
+
These are now generated within the test suite itself.
|
83
|
+
* Fixed two broken size tests, and now omits one blockdev test if there's no
|
84
|
+
media in the drive.
|
85
|
+
|
86
|
+
== 1.3.1 - 9-Aug-2008
|
87
|
+
* Fixed the stat buf to be the proper size (I had too many struct members).
|
88
|
+
* Modified the tests slightly.
|
89
|
+
|
90
|
+
== 1.3.0 - 1-Aug-2008
|
91
|
+
* Fixed a couple of function calls where I had forgotten to call an
|
92
|
+
explicitly wide version.
|
93
|
+
* No longer ignores failures on empty block devices, e.g. CD-ROM drives
|
94
|
+
without any media in them. A SystemCallError is raised instead.
|
95
|
+
* Added blockdev boolean to the inspect/pp output.
|
96
|
+
* Fixed a potential issue with an internal helper function and the new 'S'
|
97
|
+
prototype from win32-api 1.2.0 or later.
|
98
|
+
|
99
|
+
== 1.2.8 - 29-Jul-2008
|
100
|
+
* Internally now always uses wide character functions.
|
101
|
+
* A private alias was made private.
|
102
|
+
* Now requires windows-pr 0.9.1 or later.
|
103
|
+
|
104
|
+
== 1.2.7 - 1-Oct-2007
|
105
|
+
* Changed an error type in a private method in order to maintain
|
106
|
+
compatibility with the FileUtils module.
|
107
|
+
|
108
|
+
== 1.2.6 - 29-Sep-2007
|
109
|
+
* Minor tweak to the way I handle redefining the initialize method. The
|
110
|
+
old_init alias is now removed.
|
111
|
+
* Now handles a potential failure in getting the atime, ctime and mtime,
|
112
|
+
caused by the underlying filesystem, e.g. Samba. If it fails, these
|
113
|
+
fields are set to the epoch. Thanks go an anonymous user for the spot.
|
114
|
+
* Added a Rakefile that includes tasks for installation and testing.
|
115
|
+
* Removed the install.rb file. That has been inlined into the Rakefile.
|
116
|
+
|
117
|
+
== 1.2.5 - 5-Apr-2007
|
118
|
+
* Now runs -w clean.
|
119
|
+
|
120
|
+
== 1.2.4 - 22-Jan-2007
|
121
|
+
* Improved block device handling.
|
122
|
+
|
123
|
+
== 1.2.3 - 4-Nov-2006
|
124
|
+
* Bug fix for file sizes over 4gb.
|
125
|
+
|
126
|
+
== 1.2.2 - 13-May-2006
|
127
|
+
* Yet another blksize bug fix.
|
128
|
+
* Minor tweak to the pretty_print method with regards to handling nil values.
|
129
|
+
* Bumped the minimum required windows-pr version to 0.4.0 in the gemspec.
|
130
|
+
|
131
|
+
== 1.2.1 - 12-May-2006
|
132
|
+
* Fixed a bug with regards to the block count where the constructor would die
|
133
|
+
with a FloatDomainError if the blksize returned 0 or nil. It now defaults
|
134
|
+
to nil in that event.
|
135
|
+
|
136
|
+
== 1.2.0 - 23-Apr-2006
|
137
|
+
* Removed the attribute setters. From now on this class provides readonly
|
138
|
+
methods. Use the win32-file library for attribute setters.
|
139
|
+
* Added the content_indexed? alias for the indexed? method.
|
140
|
+
* Corresponding test suite changes.
|
141
|
+
* Fixed the pp issue by writing a custom pretty_print method.
|
142
|
+
|
143
|
+
== 1.1.0 - 15-Apr-2006
|
144
|
+
* Added the chardev?, dev_major, dev_minor directory?, file?, executable?,
|
145
|
+
executable_real?, ftype, grpowned?, owned?, pipe?, readable?, readable_real?,
|
146
|
+
rdev_major, rdev_minor, setgid?, setuid?, size?, socket?, sticky?, symlink?,
|
147
|
+
writable?, writable_real? and zero? methods. Note that not all of these
|
148
|
+
methods return meaningful values and were merely added to match the current
|
149
|
+
spec. See documentation for details.
|
150
|
+
* Added a VERSION constant.
|
151
|
+
* Some optimization in the constructor.
|
152
|
+
|
153
|
+
== 1.0.0 - 13-Apr-2006
|
154
|
+
* Initial release
|
data/MANIFEST
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
* CHANGES
|
2
|
-
* README
|
3
|
-
* MANIFEST
|
4
|
-
* Rakefile
|
5
|
-
* win32-file-stat.gemspec
|
6
|
-
* lib/win32/file/stat.rb
|
7
|
-
* lib/win32/file/windows/constants.rb
|
8
|
-
* lib/win32/file/windows/functions.rb
|
9
|
-
* lib/win32/file/windows/structs.rb
|
10
|
-
* test/test_file_stat.rb
|
1
|
+
* CHANGES
|
2
|
+
* README
|
3
|
+
* MANIFEST
|
4
|
+
* Rakefile
|
5
|
+
* win32-file-stat.gemspec
|
6
|
+
* lib/win32/file/stat.rb
|
7
|
+
* lib/win32/file/windows/constants.rb
|
8
|
+
* lib/win32/file/windows/functions.rb
|
9
|
+
* lib/win32/file/windows/structs.rb
|
10
|
+
* test/test_file_stat.rb
|
data/README
CHANGED
@@ -1,93 +1,94 @@
|
|
1
|
-
== Description
|
2
|
-
A redefinition of the File::Stat class for MS Windows.
|
3
|
-
|
4
|
-
== Prerequisites
|
5
|
-
* ffi
|
6
|
-
* Ruby 1.9 or later
|
7
|
-
|
8
|
-
== Installation
|
9
|
-
gem install win32-file-stat
|
10
|
-
|
11
|
-
== Synopsis
|
12
|
-
# require 'win32/file/stat' # Unwise. See below.
|
13
|
-
require 'win32/file' # Preferred. See below.
|
14
|
-
|
15
|
-
stat = File::Stat.new('file.txt')
|
16
|
-
p stat.size
|
17
|
-
p stat.readonly?
|
18
|
-
p stat.hidden?
|
19
|
-
p stat.uid
|
20
|
-
p stat.streams
|
21
|
-
|
22
|
-
== Differences between Ruby's File::Stat and this version:
|
23
|
-
* The File::Stat#blksize method returns a meaningful value.
|
24
|
-
* The File::Stat#blockdev method works more accurately.
|
25
|
-
* The File::Stat#blocks method returns a meaningful value.
|
26
|
-
* The File::Stat#executable? method works properly.
|
27
|
-
* The File::Stat#executable_real? is an alias for File::Stat#executable?
|
28
|
-
* The File::Stat#file? method works properly.
|
29
|
-
* The File::Stat#ftype method works more accurately.
|
30
|
-
* The File::Stat#pipe method works properly.
|
31
|
-
* The File::Stat#socket method works more accurately.
|
32
|
-
* The File::Stat#ino method now returns a file identifier.
|
33
|
-
* The File::Stat#
|
34
|
-
* The File::Stat#
|
35
|
-
* The File::Stat#
|
36
|
-
* The File::Stat#
|
37
|
-
* The File::Stat#
|
38
|
-
* The File::Stat#
|
39
|
-
* The
|
40
|
-
* The
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
methods
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
warranties
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
1
|
+
== Description
|
2
|
+
A redefinition of the File::Stat class for MS Windows.
|
3
|
+
|
4
|
+
== Prerequisites
|
5
|
+
* ffi
|
6
|
+
* Ruby 1.9 or later
|
7
|
+
|
8
|
+
== Installation
|
9
|
+
gem install win32-file-stat
|
10
|
+
|
11
|
+
== Synopsis
|
12
|
+
# require 'win32/file/stat' # Unwise. See below.
|
13
|
+
require 'win32/file' # Preferred. See below.
|
14
|
+
|
15
|
+
stat = File::Stat.new('file.txt')
|
16
|
+
p stat.size
|
17
|
+
p stat.readonly?
|
18
|
+
p stat.hidden?
|
19
|
+
p stat.uid
|
20
|
+
p stat.streams
|
21
|
+
|
22
|
+
== Differences between Ruby's File::Stat and this version:
|
23
|
+
* The File::Stat#blksize method returns a meaningful value.
|
24
|
+
* The File::Stat#blockdev method works more accurately.
|
25
|
+
* The File::Stat#blocks method returns a meaningful value.
|
26
|
+
* The File::Stat#executable? method works properly.
|
27
|
+
* The File::Stat#executable_real? is an alias for File::Stat#executable?
|
28
|
+
* The File::Stat#file? method works properly.
|
29
|
+
* The File::Stat#ftype method works more accurately.
|
30
|
+
* The File::Stat#pipe method works properly.
|
31
|
+
* The File::Stat#socket method works more accurately.
|
32
|
+
* The File::Stat#ino method now returns a file identifier.
|
33
|
+
* The File::Stat#socket? method works properly.
|
34
|
+
* The File::Stat#symlink? method works properly.
|
35
|
+
* The File::Stat#uid method returns a meaningful value.
|
36
|
+
* The File::Stat#gid method returns a meaningful value.
|
37
|
+
* The File::Stat#owned? method now works properly.
|
38
|
+
* The File::Stat#grpowned? method now works properly.
|
39
|
+
* The File::Stat#rdev method returns the volume serial number.
|
40
|
+
* The inspect and pretty print output has been customized.
|
41
|
+
* The File::Stat#streams was added. Returns an array of alt streams.
|
42
|
+
|
43
|
+
== Changes between this version and the previous versions.
|
44
|
+
The File::Stat#dev method has reverted to returning a drive number by
|
45
|
+
default. However, you can pass an optional boolean argument to make it
|
46
|
+
return the drive letter instead.
|
47
|
+
|
48
|
+
== Known issues
|
49
|
+
You should not require 'win32/file/stat' directly. Instead, require the
|
50
|
+
win32-file library which will, in turn, require win32-file-stat. This is
|
51
|
+
the preferred approach because some modules (i.e. 'find') use the pass-through
|
52
|
+
methods of the File class, such as File.lstat. Many of the pass through
|
53
|
+
methods have been redefined in the win32-file library to work in conjunction
|
54
|
+
with the custom File::Stat objects created by this library.
|
55
|
+
|
56
|
+
Failure to follow these instructions could lead to cases where the core Ruby
|
57
|
+
File class attempts to use the custom File::Stat object defined in this class,
|
58
|
+
and that will likely cause problems.
|
59
|
+
|
60
|
+
If run in verbose mode you will see a warning about initialize being
|
61
|
+
redefined. I can do nothing about that since my old trick of aliasing and
|
62
|
+
undefining initialize now causes a warning as well!
|
63
|
+
|
64
|
+
== Known bugs
|
65
|
+
None that I'm aware of beyond the "Known Issues" listed above. Please report
|
66
|
+
any bugs you find on the project page at:
|
67
|
+
|
68
|
+
http://www.github.com/djberg96/win32-file-stat
|
69
|
+
|
70
|
+
== Miscellaneous
|
71
|
+
I had to require 'pp' explicitly in order to deal with the fact that pp.rb
|
72
|
+
has a builtin pretty_print method for File::Stat. If I didn't do this
|
73
|
+
you would end up using the pretty_print in pp.rb, which would break.
|
74
|
+
|
75
|
+
== Contributions
|
76
|
+
Although this library is free, please consider having your company
|
77
|
+
setup a gittip if used by your company professionally.
|
78
|
+
|
79
|
+
http://www.gittip.com/djberg96/
|
80
|
+
|
81
|
+
== Copyright
|
82
|
+
(C) 2003-2015, Daniel J. Berger, All Rights Reserved.
|
83
|
+
|
84
|
+
== License
|
85
|
+
Artistic 2.0
|
86
|
+
|
87
|
+
= Warranty
|
88
|
+
This library is provided "as is" and without any express or
|
89
|
+
implied warranties, including, without limitation, the implied
|
90
|
+
warranties of merchantability and fitness for a particular purpose.
|
91
|
+
|
92
|
+
= Authors
|
93
|
+
Daniel J. Berger
|
94
|
+
Park Heesob
|