Module: NodeRb::File

Defined in:
lib/noderb/file.rb,
ext/noderb_extension/noderb.c

Instance Method Summary collapse

Instance Method Details

#file_chmod(mode) ⇒ Object



51
52
53
# File 'lib/noderb/file.rb', line 51

def file_chmod(mode)
  operation_native(9, mode)
end

#file_chown(uid, gid) ⇒ Object



55
56
57
# File 'lib/noderb/file.rb', line 55

def file_chown(uid, gid)
  operation_native(10, [uid, gid])
end

#file_closeObject



59
60
61
# File 'lib/noderb/file.rb', line 59

def file_close
  operation_native(11, nil)
end

#file_datasyncObject



35
36
37
# File 'lib/noderb/file.rb', line 35

def file_datasync
  operation_native(5, nil)
end

#file_open(file, flags = "r", mode = 600) ⇒ Object

Operations



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/noderb/file.rb', line 7

def file_open(file, flags = "r", mode = 600)
  flags = case flags
            when "r"
              1
            when "w"
              2
            else
              0
          end
  operation_native(0, [file, flags, mode])
end

#file_read(size = 1024, offset = 0) ⇒ Object



19
20
21
# File 'lib/noderb/file.rb', line 19

def file_read(size = 1024, offset = 0)
  operation_native(1, [size, offset])
end

#file_sendfile(output, offset = 0, length = 1024) ⇒ Object



43
44
45
# File 'lib/noderb/file.rb', line 43

def file_sendfile(output, offset = 0, length = 1024)
  operation_native(7, [output, offset, length])
end

#file_statObject



27
28
29
# File 'lib/noderb/file.rb', line 27

def file_stat
  operation_native(3, nil)
end

#file_syncObject



31
32
33
# File 'lib/noderb/file.rb', line 31

def file_sync
  operation_native(4, nil)
end

#file_truncate(offset = 0) ⇒ Object



39
40
41
# File 'lib/noderb/file.rb', line 39

def file_truncate(offset = 0)
  operation_native(6, offset)
end

#file_utime(atime, mtime) ⇒ Object



47
48
49
# File 'lib/noderb/file.rb', line 47

def file_utime(atime, mtime)
  operation_native(8, [atime, mtime])
end

#file_write(data) ⇒ Object



23
24
25
# File 'lib/noderb/file.rb', line 23

def file_write(data)
  operation_native(2, data)
end

#on_file_chmodObject



101
102
103
# File 'lib/noderb/file.rb', line 101

def on_file_chmod

end

#on_file_chownObject



105
106
107
# File 'lib/noderb/file.rb', line 105

def on_file_chown

end

#on_file_closeObject



109
110
111
# File 'lib/noderb/file.rb', line 109

def on_file_close

end

#on_file_datasyncObject



85
86
87
# File 'lib/noderb/file.rb', line 85

def on_file_datasync

end

#on_file_errorObject



113
114
115
# File 'lib/noderb/file.rb', line 113

def on_file_error

end

#on_file_openObject

Callbacks



65
66
67
# File 'lib/noderb/file.rb', line 65

def on_file_open

end

#on_file_read(data) ⇒ Object



69
70
71
# File 'lib/noderb/file.rb', line 69

def on_file_read(data)

end

#on_file_sendfileObject



93
94
95
# File 'lib/noderb/file.rb', line 93

def on_file_sendfile

end

#on_file_statObject



77
78
79
# File 'lib/noderb/file.rb', line 77

def on_file_stat

end

#on_file_syncObject



81
82
83
# File 'lib/noderb/file.rb', line 81

def on_file_sync

end

#on_file_truncateObject



89
90
91
# File 'lib/noderb/file.rb', line 89

def on_file_truncate

end

#on_file_utimeObject



97
98
99
# File 'lib/noderb/file.rb', line 97

def on_file_utime

end

#on_file_writeObject



73
74
75
# File 'lib/noderb/file.rb', line 73

def on_file_write

end

#operation_nativeObject

File operations