Class: Windows::Stat::Structs::WIN32_FIND_DATA
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Windows::Stat::Structs::WIN32_FIND_DATA
- Includes:
- Constants
- Defined in:
- lib/win32/file/windows/structs.rb
Instance Method Summary collapse
-
#atime ⇒ Object
Return the atime as a number.
-
#ctime ⇒ Object
Return the ctime as a number.
-
#mtime ⇒ Object
Return the mtime as a number.
-
#size ⇒ Object
Return the size as a single number.
Instance Method Details
#atime ⇒ Object
Return the atime as a number
87 88 89 90 91 92 93 |
# File 'lib/win32/file/windows/structs.rb', line 87 def atime date = ULARGE_INTEGER.new date[:u][:LowPart] = self[:ftLastAccessTime][:dwLowDateTime] date[:u][:HighPart] = self[:ftLastAccessTime][:dwHighDateTime] return 0 if date[:QuadPart]==0 date[:QuadPart] / 10000000 - 11644473600 # ns, 100-ns since Jan 1, 1601. end |
#ctime ⇒ Object
Return the ctime as a number
96 97 98 99 100 101 102 |
# File 'lib/win32/file/windows/structs.rb', line 96 def ctime date = ULARGE_INTEGER.new date[:u][:LowPart] = self[:ftCreationTime][:dwLowDateTime] date[:u][:HighPart] = self[:ftCreationTime][:dwHighDateTime] return 0 if date[:QuadPart]==0 date[:QuadPart] / 10000000 - 11644473600 # ns, 100-ns since Jan 1, 1601. end |
#mtime ⇒ Object
Return the mtime as a number
105 106 107 108 109 110 111 |
# File 'lib/win32/file/windows/structs.rb', line 105 def mtime date = ULARGE_INTEGER.new date[:u][:LowPart] = self[:ftLastWriteTime][:dwLowDateTime] date[:u][:HighPart] = self[:ftLastWriteTime][:dwHighDateTime] return 0 if date[:QuadPart]==0 date[:QuadPart] / 10000000 - 11644473600 # ns, 100-ns since Jan 1, 1601. end |
#size ⇒ Object
Return the size as a single number
114 115 116 |
# File 'lib/win32/file/windows/structs.rb', line 114 def size (self[:nFileSizeHigh] * (MAXDWORD + 1)) + self[:nFileSizeLow] end |