Module: RIO::Ops::File::Existing

Includes:
Cp::File::Input, Cp::File::Output, Ext::Mp3Info, ExistOrNot, RIO::Ops::FileOrDir::Existing, Piper::Cp::Input
Included in:
File::Existing
Defined in:
lib/rio/ops/file.rb,
lib/rio/ext/mp3info.rb

Instance Method Summary collapse

Methods included from Ext::Mp3Info

#album, #artist, #mp3info, #mp3length, #time, #title, #vbr, #year

Methods included from Fwd

#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers

Methods included from Piper::Cp::Input

#has_output_dest?, #last_rio, #|

Methods included from Cp::File::Input

#>, #>>, #copy_as_file?, #spcp

Methods included from Cp::Util::InOut

#cpclose, #cpclose0

Methods included from Cp::File::Output

#<, #<<

Methods included from RIO::Ops::FileOrDir::Existing

#basename=, #chmod, #chown, #dirname=, #extname=, #filename=, #mountpoint?, #must_exist, #realpath, #rename, #rename!, #ss_type?

Instance Method Details

#clearObject



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

Returns:

  • (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

Returns:

  • (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