Class: Recls::Ximpl::FileStat

Inherits:
File::Stat
  • Object
show all
Defined in:
lib/recls/ximpl/unix.rb,
lib/recls/ximpl/windows.rb

Overview

:nodoc:

Defined Under Namespace

Classes: ByHandleInformation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



145
146
147
# File 'lib/recls/ximpl/windows.rb', line 145

def attributes
  @attributes
end

#by_handle_informationObject (readonly)

Returns the value of attribute by_handle_information.



147
148
149
# File 'lib/recls/ximpl/windows.rb', line 147

def by_handle_information
  @by_handle_information
end

#pathObject (readonly)

Returns the value of attribute path.



59
60
61
# File 'lib/recls/ximpl/unix.rb', line 59

def path
  @path
end

#short_pathObject (readonly)

Returns the value of attribute short_path.



148
149
150
# File 'lib/recls/ximpl/windows.rb', line 148

def short_path
  @short_path
end

Class Method Details

.stat(path) ⇒ Object



74
75
76
77
78
# File 'lib/recls/ximpl/unix.rb', line 74

def FileStat.stat(path)

  Recls::Ximpl::FileStat.new(path)

end

Instance Method Details

#archive?Boolean

Returns:

  • (Boolean)


162
163
164
165
# File 'lib/recls/ximpl/windows.rb', line 162

def archive?

  has_attribute_? FILE_ATTRIBUTE_ARCHIVE
end

#compressed?Boolean

Returns:

  • (Boolean)


182
183
184
185
# File 'lib/recls/ximpl/windows.rb', line 182

def compressed?

  has_attribute_? FILE_ATTRIBUTE_COMPRESSED
end

#device?Boolean

Returns:

  • (Boolean)


167
168
169
170
# File 'lib/recls/ximpl/windows.rb', line 167

def device?

  has_attribute_? FILE_ATTRIBUTE_DEVICE
end

#encrypted?Boolean

Returns:

  • (Boolean)


187
188
189
190
# File 'lib/recls/ximpl/windows.rb', line 187

def encrypted?

  has_attribute_? FILE_ATTRIBUTE_ENCRYPTED
end

#hidden?Boolean

Returns:

  • (Boolean)


61
62
63
64
65
66
67
68
69
70
71
# File 'lib/recls/ximpl/unix.rb', line 61

def hidden?

  basename = File.basename @path

  return false if basename.empty?
  return false if '.' == basename
  return false if '..' == basename
  return false if ?. != basename[0]

  return true
end

#normal?Boolean

Returns:

  • (Boolean)


172
173
174
175
# File 'lib/recls/ximpl/windows.rb', line 172

def normal?

  has_attribute_? FILE_ATTRIBUTE_NORMAL
end

#system?Boolean

Windows-specific attributes

Returns:

  • (Boolean)


157
158
159
160
# File 'lib/recls/ximpl/windows.rb', line 157

def system?

  has_attribute_? FILE_ATTRIBUTE_SYSTEM
end

#temporary?Boolean

Returns:

  • (Boolean)


177
178
179
180
# File 'lib/recls/ximpl/windows.rb', line 177

def temporary?

  has_attribute_? FILE_ATTRIBUTE_TEMPORARY
end