Module: RIO::Ops::File::Existing
Instance Method Summary
collapse
#album, #artist, #mp3info, #mp3length, #time, #title, #vbr, #year
Methods included from Fwd
#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers
#has_output_dest?, #last_rio, #|
#>, #>>, #copy_as_file?, #spcp
#cpclose, #cpclose0
#<, #<<
#basename=, #chmod, #chown, #dirname=, #extname=, #filename=, #mountpoint?, #must_exist, #realpath, #rename, #rename!, #ss_type?
Instance Method Details
59
|
# File 'lib/rio/ops/file.rb', line 59
def clear() truncate(0) end
|
#delete(*args) ⇒ Object
Also known as:
rm, unlink, delete!
44
45
46
47
48
|
# File 'lib/rio/ops/file.rb', line 44
def delete(*args)
rtn_reset {
fs.delete(self,*args)
}
end
|
#empty? ⇒ Boolean
41
42
43
|
# File 'lib/rio/ops/file.rb', line 41
def empty?()
self.selective? ? self.to_a.empty? : self.size == 0
end
|
#selective? ⇒ Boolean
38
39
40
|
# File 'lib/rio/ops/file.rb', line 38
def selective?
%w[stream_sel stream_nosel].any? { |k| cx.has_key?(k) }
end
|
#touch(*args) ⇒ Object
52
|
# File 'lib/rio/ops/file.rb', line 52
def touch(*args) rtn_self { fs.touch(self.to_s,*args) } end
|
#truncate(sz = 0) ⇒ Object
53
54
55
56
57
58
|
# File 'lib/rio/ops/file.rb', line 53
def truncate(sz=0)
rtn_reset {
sz = 0 if sz < 0
fs.truncate(self.to_s,sz)
}
end
|