Module: NestedFile::PutDir::Raw

Included in:
NestedFile::PutDir
Defined in:
lib/nested_file/put_dir.rb

Instance Method Summary collapse

Instance Method Details

#raw_close(*args) ⇒ Object



73
74
75
# File 'lib/nested_file/put_dir.rb', line 73

def raw_close(*args)
  args.last.close
end

#raw_open(path, *args) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/nested_file/put_dir.rb', line 63

def raw_open(path,*args)
  if args[0] == 'w'
    File.new(mount_to_parent(path),'w')
  else
    nil
  end
end

#raw_truncate(path, i, f) ⇒ Object



70
71
72
# File 'lib/nested_file/put_dir.rb', line 70

def raw_truncate(path,i,f)
  f.truncate(i)
end

#raw_write(path, offset, sz, buf, file = nil) ⇒ Object



76
77
78
79
# File 'lib/nested_file/put_dir.rb', line 76

def raw_write(path,offset,sz,buf,file=nil)
  PutFile.new(raw_body: buf, filename: mount_to_parent(path), convert_path: relative_convert_path).write_all! file
  buf.length
end