Module: Junos::Ez::FS

Defined in:
lib/junos-ez/utils/fs.rb

Overview


FS::Utils is a collection of filesystem utility routines. These do not map to configuration resources. However, the provider framework lends itself well in case we need to do something later, yo!

Each of the FS::Util methods will provide back a rubyized structure by default. The ‘options’ hash to each method will allow you to change the return result in either :text or Junos :xml as well.

The following is a quick list of the filesystem utility methods, these following the unix naming counterparts (mostly)

cat - returns the contents of the file (String)
checksum - returns the checksum of a file
cleanup? - returns Hash info of files that would be removed by ...
cleanup! - performs a system storage cleanup
cp! - local file copy (use 'scp' if you want to copy remote/local)
cwd - change the working directory (String)
df - shows the system storage (Hash)
ls - returns a filesystem listing (Hash)
mv! - rename/move files (true | String error)
pwd - return the current working directory (String)
rm! - remove files (String)

Defined Under Namespace

Classes: Provider

Class Method Summary collapse

Class Method Details

.Utils(ndev, varsym) ⇒ Object



30
31
32
33
# File 'lib/junos-ez/utils/fs.rb', line 30

def self.Utils( ndev, varsym )            
  newbie = Junos::Ez::FS::Provider.new( ndev )      
  Junos::Ez::Provider.attach_instance_variable( ndev, varsym, newbie )    
end