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 Piper::Cp::Input

#|

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



87
# File 'lib/rio/ops/file.rb', line 87

def clear() truncate(0) end

#empty?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/rio/ops/file.rb', line 75

def empty?() 
  self.selective? ? self.to_a.empty? : self.size == 0 
end

#rm(*args) ⇒ Object Also known as: delete, delete!



78
79
80
81
82
# File 'lib/rio/ops/file.rb', line 78

def rm(*args) 
  rtn_reset { 
    fs.rm(self,*args) 
  } 
end

#selective?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/rio/ops/file.rb', line 72

def selective?
  %w[stream_sel stream_nosel].any? { |k| cx.has_key?(k) }
end

#touch(*args) ⇒ Object



85
# File 'lib/rio/ops/file.rb', line 85

def touch(*args) rtn_self { fs.touch(self.to_s,*args) } end

#truncate(sz = 0) ⇒ Object



86
# File 'lib/rio/ops/file.rb', line 86

def truncate(sz=0) rtn_reset { fs.truncate(self.to_s,sz) } end