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