Class: Qfs::Attr
- Inherits:
-
Object
- Object
- Qfs::Attr
- Defined in:
- lib/qfs.rb,
ext/qfs/attr.c
Overview
A container class for the properties of a file or directory. These can be retrieved with either Client::stat or File#stat.
Instance Attribute Summary collapse
-
#chunks ⇒ Int
readonly
The number of chunks in the file or files in a directory.
-
#ctime ⇒ Time
readonly
The time the file/directory’s attributes were changed.
-
#directories ⇒ Int
readonly
The number of subdirectories.
-
#directory ⇒ Bool
readonly
If the file is a directory.
-
#filename ⇒ String
readonly
The base name of the file/directory.
-
#gid ⇒ Int
readonly
Group ID.
-
#id ⇒ Int
readonly
The current value of id.
-
#max_stier ⇒ Int
readonly
The current value of max_stier.
-
#min_stier ⇒ Int
readonly
The current value of min_stier.
-
#mode ⇒ Int
readonly
The permissions set on the file/directory.
-
#mtime ⇒ Time
readonly
The time last modified.
-
#recovery_stripes ⇒ Int
readonly
The current value of recovery_stripes.
-
#replicas ⇒ Int
readonly
The current value of replicas.
-
#size ⇒ Int
readonly
The size of the file.
-
#stripe_size ⇒ Int
readonly
The current value of stripe_size.
-
#striper_type ⇒ Int
readonly
The current value of striper_type.
-
#stripes ⇒ Int
readonly
The current value of stripes.
-
#uid ⇒ Int
readonly
User ID.
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #strip_size ⇒ Object
-
#to_s ⇒ Object
Attempt to mimic the format of the QFS “ls” command.
Instance Attribute Details
#chunks ⇒ Int (readonly)
The number of chunks in the file or files in a directory
363 364 365 |
# File 'lib/qfs.rb', line 363 def chunks @chunks end |
#ctime ⇒ Time (readonly)
The time the file/directory’s attributes were changed
363 364 365 |
# File 'lib/qfs.rb', line 363 def ctime @ctime end |
#directories ⇒ Int (readonly)
The number of subdirectories
363 364 365 |
# File 'lib/qfs.rb', line 363 def directories @directories end |
#directory ⇒ Bool (readonly)
If the file is a directory
363 364 365 |
# File 'lib/qfs.rb', line 363 def directory @directory end |
#filename ⇒ String (readonly)
The base name of the file/directory
363 364 365 |
# File 'lib/qfs.rb', line 363 def filename @filename end |
#gid ⇒ Int (readonly)
Group ID
363 364 365 |
# File 'lib/qfs.rb', line 363 def gid @gid end |
#id ⇒ Int (readonly)
Returns the current value of id.
363 364 365 |
# File 'lib/qfs.rb', line 363 def id @id end |
#max_stier ⇒ Int (readonly)
Returns the current value of max_stier.
363 364 365 |
# File 'lib/qfs.rb', line 363 def max_stier @max_stier end |
#min_stier ⇒ Int (readonly)
Returns the current value of min_stier.
363 364 365 |
# File 'lib/qfs.rb', line 363 def min_stier @min_stier end |
#mode ⇒ Int (readonly)
The permissions set on the file/directory
363 364 365 |
# File 'lib/qfs.rb', line 363 def mode @mode end |
#mtime ⇒ Time (readonly)
The time last modified
363 364 365 |
# File 'lib/qfs.rb', line 363 def mtime @mtime end |
#recovery_stripes ⇒ Int (readonly)
Returns the current value of recovery_stripes.
363 364 365 |
# File 'lib/qfs.rb', line 363 def recovery_stripes @recovery_stripes end |
#replicas ⇒ Int (readonly)
Returns the current value of replicas.
363 364 365 |
# File 'lib/qfs.rb', line 363 def replicas @replicas end |
#size ⇒ Int (readonly)
The size of the file
363 364 365 |
# File 'lib/qfs.rb', line 363 def size @size end |
#stripe_size ⇒ Int (readonly)
Returns the current value of stripe_size.
363 364 365 |
# File 'lib/qfs.rb', line 363 def stripe_size @stripe_size end |
#striper_type ⇒ Int (readonly)
Returns the current value of striper_type.
363 364 365 |
# File 'lib/qfs.rb', line 363 def striper_type @striper_type end |
#stripes ⇒ Int (readonly)
Returns the current value of stripes.
363 364 365 |
# File 'lib/qfs.rb', line 363 def stripes @stripes end |
#uid ⇒ Int (readonly)
User ID
363 364 365 |
# File 'lib/qfs.rb', line 363 def uid @uid end |
Instance Method Details
#directory? ⇒ Boolean
#strip_size ⇒ Object
#to_s ⇒ Object
Attempt to mimic the format of the QFS “ls” command
365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/qfs.rb', line 365 def to_s [ "#{directory? ? 'd' : '-'}#{mode_to_s}", '-', uid, gid, size, mtime.strftime('%Y-%m-%d %H:%M'), filename, ].join(' ') end |