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.



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

def attributes
  @attributes
end

#by_handle_informationObject (readonly)

Returns the value of attribute by_handle_information.



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

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.



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

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)


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

def archive?

	has_attribute_? FILE_ATTRIBUTE_ARCHIVE
end

#compressed?Boolean

Returns:

  • (Boolean)


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

def compressed?

	has_attribute_? FILE_ATTRIBUTE_COMPRESSED
end

#device?Boolean

Returns:

  • (Boolean)


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

def device?

	has_attribute_? FILE_ATTRIBUTE_DEVICE
end

#encrypted?Boolean

Returns:

  • (Boolean)


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

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)


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

def normal?

	has_attribute_? FILE_ATTRIBUTE_NORMAL
end

#system?Boolean

Windows-specific attributes

Returns:

  • (Boolean)


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

def system?

	has_attribute_? FILE_ATTRIBUTE_SYSTEM
end

#temporary?Boolean

Returns:

  • (Boolean)


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

def temporary?

	has_attribute_? FILE_ATTRIBUTE_TEMPORARY
end