Class: Recls::Ximpl::FileStat

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

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.



140
141
142
# File 'lib/recls/ximpl/windows.rb', line 140

def attributes
  @attributes
end

#by_handle_informationObject (readonly)

Returns the value of attribute by_handle_information.



142
143
144
# File 'lib/recls/ximpl/windows.rb', line 142

def by_handle_information
  @by_handle_information
end

#pathObject (readonly)

Returns the value of attribute path.



56
57
58
# File 'lib/recls/ximpl/unix.rb', line 56

def path
  @path
end

#short_pathObject (readonly)

Returns the value of attribute short_path.



143
144
145
# File 'lib/recls/ximpl/windows.rb', line 143

def short_path
  @short_path
end

Class Method Details

.stat(path) ⇒ Object



71
72
73
74
75
# File 'lib/recls/ximpl/unix.rb', line 71

def FileStat.stat(path)

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

end

Instance Method Details

#archive?Boolean

Returns:

  • (Boolean)


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

def archive?

	has_attribute_? FILE_ATTRIBUTE_ARCHIVE
end

#compressed?Boolean

Returns:

  • (Boolean)


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

def compressed?

	has_attribute_? FILE_ATTRIBUTE_COMPRESSED
end

#device?Boolean

Returns:

  • (Boolean)


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

def device?

	has_attribute_? FILE_ATTRIBUTE_DEVICE
end

#encrypted?Boolean

Returns:

  • (Boolean)


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

def encrypted?

	has_attribute_? FILE_ATTRIBUTE_ENCRYPTED
end

#hidden?Boolean

Returns:

  • (Boolean)


58
59
60
61
62
63
64
65
66
67
68
# File 'lib/recls/ximpl/unix.rb', line 58

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)


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

def normal?

	has_attribute_? FILE_ATTRIBUTE_NORMAL
end

#system?Boolean

Windows-specific attributes

Returns:

  • (Boolean)


152
153
154
155
# File 'lib/recls/ximpl/windows.rb', line 152

def system?

	has_attribute_? FILE_ATTRIBUTE_SYSTEM
end

#temporary?Boolean

Returns:

  • (Boolean)


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

def temporary?

	has_attribute_? FILE_ATTRIBUTE_TEMPORARY
end