rfuse 1.1.0.RC0 → 1.2.0.rc202009.69
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +12 -0
- data/README.md +3 -2
- data/ext/rfuse/rfuse.c +2 -3
- data/lib/rfuse.rb +1 -1
- data/lib/rfuse/version.rb +1 -1
- metadata +8 -25
- data/.gitignore +0 -5
- data/Gemfile +0 -4
- data/Rakefile +0 -17
- data/ext/.gitignore +0 -2
- data/rfuse.gemspec +0 -31
- data/sample/test-ruby.rb +0 -310
- data/spec/basic_spec.rb +0 -243
- data/spec/fuse_file_info_spec.rb +0 -75
- data/spec/main_spec.rb +0 -161
- data/spec/options_spec.rb +0 -135
- data/spec/ruby_loop_spec.rb +0 -63
- data/spec/run_spec.rb +0 -60
- data/spec/signals_spec.rb +0 -108
- data/spec/spec_helper.rb +0 -109
- data/spec/xattr_spec.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b0c74a0b63edd60924aca38377448082c0d18458e2fc00c03c41995916e4f732
|
4
|
+
data.tar.gz: f89427f04c1e599e2cd22a7418c99c76480b6369b9db583168273ee9934a806e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27b6dabe961b7bb99d29769cda582605ca44d01c0f5fc3ba1b8081374d386ff7e7c19b7aedc0d4fe96141d76588753e272870d9ffbd869891f77b96cd83fef77
|
7
|
+
data.tar.gz: c24789220563cf4d91714fd95905ab3ce865f1c44da04992ad947c710ef3599d6b331eb9332ce81e089ca25b018faab96429b23c32cfa7c6dfdae027f8fbd617
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,7 @@ RFuse
|
|
2
2
|
===============
|
3
3
|
|
4
4
|
http://rubygems.org/gems/rfuse
|
5
|
+
![Gem Version](https://badge.fury.io/rb/rfuse.png)
|
5
6
|
|
6
7
|
Ruby FUSE binding
|
7
8
|
|
@@ -14,8 +15,8 @@ For a more ruby-ish API for creating filesystems see {http://rubygems.org/gems/r
|
|
14
15
|
Dependencies
|
15
16
|
--------------
|
16
17
|
|
17
|
-
* Ruby
|
18
|
-
* Fuse 2.8
|
18
|
+
* Ruby 2.5+
|
19
|
+
* Fuse 2.8+
|
19
20
|
|
20
21
|
Installation
|
21
22
|
---------------
|
data/ext/rfuse/rfuse.c
CHANGED
@@ -1156,8 +1156,7 @@ static int rf_opendir(const char *path,struct fuse_file_info *ffi)
|
|
1156
1156
|
*/
|
1157
1157
|
static VALUE unsafe_releasedir(VALUE *args)
|
1158
1158
|
{
|
1159
|
-
|
1160
|
-
return rb_funcall(args[0],rb_intern("releasedir"),3,&args[1]);
|
1159
|
+
return rb_funcall3(args[0],rb_intern("releasedir"),3,&args[1]);
|
1161
1160
|
}
|
1162
1161
|
|
1163
1162
|
static int rf_releasedir(const char *path,struct fuse_file_info *ffi)
|
@@ -1191,7 +1190,7 @@ static int rf_releasedir(const char *path,struct fuse_file_info *ffi)
|
|
1191
1190
|
*/
|
1192
1191
|
static VALUE unsafe_fsyncdir(VALUE *args)
|
1193
1192
|
{
|
1194
|
-
return
|
1193
|
+
return rb_funcall2(args[0],rb_intern("fsyncdir"),4,&args[1]);
|
1195
1194
|
}
|
1196
1195
|
|
1197
1196
|
static int rf_fsyncdir(const char *path,int meta,struct fuse_file_info *ffi)
|
data/lib/rfuse.rb
CHANGED
@@ -74,7 +74,7 @@ module RFuse
|
|
74
74
|
def self.parse_options(argv,*local_opts)
|
75
75
|
result = Hash.new(nil)
|
76
76
|
|
77
|
-
first_opt_index = (argv.find_index() { |opt| opt =~
|
77
|
+
first_opt_index = (argv.find_index() { |opt| opt =~ /^-.*/ } || argv.length )
|
78
78
|
|
79
79
|
result[:device] = argv.shift if first_opt_index > 1
|
80
80
|
result[:mountpoint] = argv[0] if argv.length > 0
|
data/lib/rfuse/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0.rc202009.69
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Gardner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,14 +117,10 @@ extensions:
|
|
117
117
|
extra_rdoc_files:
|
118
118
|
- CHANGES.md
|
119
119
|
files:
|
120
|
-
- ".gitignore"
|
121
120
|
- ".yardopts"
|
122
121
|
- CHANGES.md
|
123
|
-
- Gemfile
|
124
122
|
- LICENSE
|
125
123
|
- README.md
|
126
|
-
- Rakefile
|
127
|
-
- ext/.gitignore
|
128
124
|
- ext/rfuse/bufferwrapper.c
|
129
125
|
- ext/rfuse/bufferwrapper.h
|
130
126
|
- ext/rfuse/context.c
|
@@ -149,17 +145,6 @@ files:
|
|
149
145
|
- lib/rfuse/compat.rb
|
150
146
|
- lib/rfuse/version.rb
|
151
147
|
- lib/rfuse_ng.rb
|
152
|
-
- rfuse.gemspec
|
153
|
-
- sample/test-ruby.rb
|
154
|
-
- spec/basic_spec.rb
|
155
|
-
- spec/fuse_file_info_spec.rb
|
156
|
-
- spec/main_spec.rb
|
157
|
-
- spec/options_spec.rb
|
158
|
-
- spec/ruby_loop_spec.rb
|
159
|
-
- spec/run_spec.rb
|
160
|
-
- spec/signals_spec.rb
|
161
|
-
- spec/spec_helper.rb
|
162
|
-
- spec/xattr_spec.rb
|
163
148
|
homepage: http://rubygems.org/gems/rfuse
|
164
149
|
licenses: []
|
165
150
|
metadata: {}
|
@@ -171,17 +156,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
156
|
requirements:
|
172
157
|
- - ">="
|
173
158
|
- !ruby/object:Gem::Version
|
174
|
-
version: '
|
159
|
+
version: '2.5'
|
175
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
161
|
requirements:
|
177
162
|
- - ">"
|
178
163
|
- !ruby/object:Gem::Version
|
179
164
|
version: 1.3.1
|
180
165
|
requirements: []
|
181
|
-
|
182
|
-
rubygems_version: 2.2.2
|
166
|
+
rubygems_version: 3.0.8
|
183
167
|
signing_key:
|
184
168
|
specification_version: 4
|
185
169
|
summary: Ruby language binding for FUSE
|
186
170
|
test_files: []
|
187
|
-
has_rdoc: yard
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
require "bundler/gem_tasks"
|
3
|
-
require 'yard'
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
require 'rake/extensiontask'
|
6
|
-
|
7
|
-
CLOBBER.include("pkg","doc")
|
8
|
-
RSpec::Core::RakeTask.new(:spec)
|
9
|
-
|
10
|
-
YARD::Rake::YardocTask.new
|
11
|
-
|
12
|
-
Rake::ExtensionTask.new('rfuse') do |ext|
|
13
|
-
ext.lib_dir = "lib/rfuse"
|
14
|
-
end
|
15
|
-
|
16
|
-
task :spec => :compile
|
17
|
-
task :default => :spec
|
data/ext/.gitignore
DELETED
data/rfuse.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "rfuse/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "rfuse"
|
7
|
-
s.version = RFuse::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Grant Gardner"]
|
10
|
-
s.email = ["grant@lastweekend.com.au"]
|
11
|
-
s.homepage = "http://rubygems.org/gems/rfuse"
|
12
|
-
s.summary = %q{Ruby language binding for FUSE}
|
13
|
-
s.description = %q{Write userspace filesystems in Ruby}
|
14
|
-
|
15
|
-
s.files = `git ls-files`.split("\n")
|
16
|
-
s.extensions = 'ext/rfuse/extconf.rb'
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = ["lib"]
|
20
|
-
|
21
|
-
s.has_rdoc = 'yard'
|
22
|
-
s.extra_rdoc_files = 'CHANGES.md'
|
23
|
-
|
24
|
-
s.add_development_dependency("rake")
|
25
|
-
s.add_development_dependency("rake-compiler")
|
26
|
-
s.add_development_dependency("rspec","~> 3.0.0")
|
27
|
-
s.add_development_dependency("yard")
|
28
|
-
s.add_development_dependency("redcarpet")
|
29
|
-
s.add_development_dependency("ffi-xattr")
|
30
|
-
s.add_development_dependency("sys-filesystem")
|
31
|
-
end
|
data/sample/test-ruby.rb
DELETED
@@ -1,310 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
# TestFS for RFuse
|
4
|
-
|
5
|
-
require "rfuse"
|
6
|
-
|
7
|
-
class MyDir < Hash
|
8
|
-
attr_accessor :name, :mode , :actime, :modtime, :uid, :gid
|
9
|
-
def initialize(name,mode)
|
10
|
-
@uid=0
|
11
|
-
@gid=0
|
12
|
-
@actime=Time.now
|
13
|
-
@modtime=Time.now
|
14
|
-
@xattr=Hash.new
|
15
|
-
@name=name
|
16
|
-
@mode=mode
|
17
|
-
end
|
18
|
-
|
19
|
-
def stat
|
20
|
-
RFuse::Stat.directory(mode,:uid => uid, :gid => gid, :atime => actime, :mtime => modtime,
|
21
|
-
:size => size)
|
22
|
-
end
|
23
|
-
|
24
|
-
def listxattr()
|
25
|
-
@xattr.keys()
|
26
|
-
end
|
27
|
-
def setxattr(name,value,flag)
|
28
|
-
@xattr[name]=value #TODO:don't ignore flag
|
29
|
-
end
|
30
|
-
def getxattr(name)
|
31
|
-
return @xattr[name]
|
32
|
-
end
|
33
|
-
def removexattr(name)
|
34
|
-
@xattr.delete(name)
|
35
|
-
end
|
36
|
-
def size
|
37
|
-
return 48 #for testing only
|
38
|
-
end
|
39
|
-
def isdir
|
40
|
-
true
|
41
|
-
end
|
42
|
-
def insert_obj(obj,path)
|
43
|
-
d=self.search(File.dirname(path))
|
44
|
-
if d.isdir then
|
45
|
-
d[obj.name]=obj
|
46
|
-
else
|
47
|
-
raise Errno::ENOTDIR.new(d.name)
|
48
|
-
end
|
49
|
-
return d
|
50
|
-
end
|
51
|
-
def remove_obj(path)
|
52
|
-
d=self.search(File.dirname(path))
|
53
|
-
d.delete(File.basename(path))
|
54
|
-
end
|
55
|
-
def search(path)
|
56
|
-
p=path.split('/').delete_if {|x| x==''}
|
57
|
-
if p.length==0 then
|
58
|
-
return self
|
59
|
-
else
|
60
|
-
return self.follow(p)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
def follow (path_array)
|
64
|
-
if path_array.length==0 then
|
65
|
-
return self
|
66
|
-
else
|
67
|
-
d=self[path_array.shift]
|
68
|
-
if d then
|
69
|
-
return d.follow(path_array)
|
70
|
-
else
|
71
|
-
raise Errno::ENOENT.new
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
def to_s
|
76
|
-
return "Dir: " + @name + "(" + @mode.to_s + ")"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
class MyFile
|
81
|
-
attr_accessor :name, :mode, :actime, :modtime, :uid, :gid, :content
|
82
|
-
def initialize(name,mode,uid,gid)
|
83
|
-
@actime=0
|
84
|
-
@modtime=0
|
85
|
-
@xattr=Hash.new
|
86
|
-
@content=""
|
87
|
-
@uid=uid
|
88
|
-
@gid=gid
|
89
|
-
@name=name
|
90
|
-
@mode=mode
|
91
|
-
end
|
92
|
-
|
93
|
-
def stat
|
94
|
-
RFuse::Stat.file(mode,:uid => uid, :gid => gid, :atime => actime, :mtime => modtime,
|
95
|
-
:size => size)
|
96
|
-
end
|
97
|
-
|
98
|
-
def listxattr()
|
99
|
-
@xattr.keys
|
100
|
-
end
|
101
|
-
|
102
|
-
def setxattr(name,value,flag)
|
103
|
-
@xattr[name]=value #TODO:don't ignore flag
|
104
|
-
end
|
105
|
-
|
106
|
-
def getxattr(name)
|
107
|
-
return @xattr[name]
|
108
|
-
end
|
109
|
-
def removexattr(name)
|
110
|
-
@xattr.delete(name)
|
111
|
-
end
|
112
|
-
def size
|
113
|
-
return content.size
|
114
|
-
end
|
115
|
-
def isdir
|
116
|
-
false
|
117
|
-
end
|
118
|
-
def follow(path_array)
|
119
|
-
if path_array.length != 0 then
|
120
|
-
raise Errno::ENOTDIR.new
|
121
|
-
else
|
122
|
-
return self
|
123
|
-
end
|
124
|
-
end
|
125
|
-
def to_s
|
126
|
-
return "File: " + @name + "(" + @mode.to_s + ")"
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
class MyFuse
|
131
|
-
|
132
|
-
def initialize(root)
|
133
|
-
@root=root
|
134
|
-
end
|
135
|
-
|
136
|
-
# The new readdir way, c+p-ed from getdir
|
137
|
-
def readdir(ctx,path,filler,offset,ffi)
|
138
|
-
d=@root.search(path)
|
139
|
-
if d.isdir then
|
140
|
-
d.each {|name,obj|
|
141
|
-
filler.push(name,obj.stat,0)
|
142
|
-
}
|
143
|
-
else
|
144
|
-
raise Errno::ENOTDIR.new(path)
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
def getattr(ctx,path)
|
149
|
-
d = @root.search(path)
|
150
|
-
return d.stat
|
151
|
-
end #getattr
|
152
|
-
|
153
|
-
def mkdir(ctx,path,mode)
|
154
|
-
@root.insert_obj(MyDir.new(File.basename(path),mode),path)
|
155
|
-
end #mkdir
|
156
|
-
|
157
|
-
def mknod(ctx,path,mode,major,minor)
|
158
|
-
@root.insert_obj(MyFile.new(File.basename(path),mode,ctx.uid,ctx.gid),path)
|
159
|
-
end #mknod
|
160
|
-
|
161
|
-
def open(ctx,path,ffi)
|
162
|
-
end
|
163
|
-
|
164
|
-
#def release(ctx,path,fi)
|
165
|
-
#end
|
166
|
-
|
167
|
-
#def flush(ctx,path,fi)
|
168
|
-
#end
|
169
|
-
|
170
|
-
def chmod(ctx,path,mode)
|
171
|
-
d=@root.search(path)
|
172
|
-
d.mode=mode
|
173
|
-
end
|
174
|
-
|
175
|
-
def chown(ctx,path,uid,gid)
|
176
|
-
d=@root.search(path)
|
177
|
-
d.uid=uid
|
178
|
-
d.gid=gid
|
179
|
-
end
|
180
|
-
|
181
|
-
def truncate(ctx,path,offset)
|
182
|
-
d=@root.search(path)
|
183
|
-
d.content = d.content[0..offset]
|
184
|
-
end
|
185
|
-
|
186
|
-
def utime(ctx,path,actime,modtime)
|
187
|
-
d=@root.search(path)
|
188
|
-
d.actime=actime
|
189
|
-
d.modtime=modtime
|
190
|
-
end
|
191
|
-
|
192
|
-
def unlink(ctx,path)
|
193
|
-
@root.remove_obj(path)
|
194
|
-
end
|
195
|
-
|
196
|
-
def rmdir(ctx,path)
|
197
|
-
@root.remove_obj(path)
|
198
|
-
end
|
199
|
-
|
200
|
-
#def symlink(ctx,path,as)
|
201
|
-
#end
|
202
|
-
|
203
|
-
def rename(ctx,path,as)
|
204
|
-
d = @root.search(path)
|
205
|
-
@root.remove_obj(path)
|
206
|
-
@root.insert_obj(d,path)
|
207
|
-
end
|
208
|
-
|
209
|
-
#def link(ctx,path,as)
|
210
|
-
#end
|
211
|
-
|
212
|
-
def read(ctx,path,size,offset,fi)
|
213
|
-
d = @root.search(path)
|
214
|
-
if (d.isdir)
|
215
|
-
raise Errno::EISDIR.new(path)
|
216
|
-
return nil
|
217
|
-
else
|
218
|
-
return d.content[offset..offset + size - 1]
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
def write(ctx,path,buf,offset,fi)
|
223
|
-
d=@root.search(path)
|
224
|
-
if (d.isdir)
|
225
|
-
raise Errno::EISDIR.new(path)
|
226
|
-
else
|
227
|
-
d.content[offset..offset+buf.length - 1] = buf
|
228
|
-
end
|
229
|
-
return buf.length
|
230
|
-
end
|
231
|
-
|
232
|
-
def setxattr(ctx,path,name,value,size,flags)
|
233
|
-
d=@root.search(path)
|
234
|
-
d.setxattr(name,value,flags)
|
235
|
-
end
|
236
|
-
|
237
|
-
def getxattr(ctx,path,name)
|
238
|
-
d=@root.search(path)
|
239
|
-
if (d)
|
240
|
-
value=d.getxattr(name)
|
241
|
-
if (!value)
|
242
|
-
value=""
|
243
|
-
#raise Errno::ENOENT.new #TODO raise the correct error :
|
244
|
-
#NOATTR which is not implemented in Linux/glibc
|
245
|
-
end
|
246
|
-
else
|
247
|
-
raise Errno::ENOENT.new
|
248
|
-
end
|
249
|
-
return value
|
250
|
-
end
|
251
|
-
|
252
|
-
def listxattr(ctx,path)
|
253
|
-
d=@root.search(path)
|
254
|
-
value= d.listxattr()
|
255
|
-
return value
|
256
|
-
end
|
257
|
-
|
258
|
-
def removexattr(ctx,path,name)
|
259
|
-
d=@root.search(path)
|
260
|
-
d.removexattr(name)
|
261
|
-
end
|
262
|
-
|
263
|
-
#def opendir(ctx,path,ffi)
|
264
|
-
#end
|
265
|
-
|
266
|
-
#def releasedir(ctx,path,ffi)
|
267
|
-
#end
|
268
|
-
|
269
|
-
#def fsyncdir(ctx,path,meta,ffi)
|
270
|
-
#end
|
271
|
-
|
272
|
-
# Some random numbers to show with df command
|
273
|
-
def statfs(ctx,path)
|
274
|
-
s = RFuse::StatVfs.new()
|
275
|
-
s.f_bsize = 1024
|
276
|
-
s.f_frsize = 1024
|
277
|
-
s.f_blocks = 1000000
|
278
|
-
s.f_bfree = 500000
|
279
|
-
s.f_bavail = 990000
|
280
|
-
s.f_files = 10000
|
281
|
-
s.f_ffree = 9900
|
282
|
-
s.f_favail = 9900
|
283
|
-
s.f_fsid = 23423
|
284
|
-
s.f_flag = 0
|
285
|
-
s.f_namemax = 10000
|
286
|
-
return s
|
287
|
-
end
|
288
|
-
|
289
|
-
def ioctl(ctx, path, cmd, arg, ffi, flags, data)
|
290
|
-
# FT: I was not been able to test it.
|
291
|
-
print "*** IOCTL: command: ", cmd, "\n"
|
292
|
-
end
|
293
|
-
|
294
|
-
def poll(ctx, path, ffi, ph, reventsp)
|
295
|
-
print "*** POLL: ", path, "\n"
|
296
|
-
# This is how we notify the caller if something happens:
|
297
|
-
ph.notifyPoll();
|
298
|
-
# when the GC harvests the object it calls fuse_pollhandle_destroy
|
299
|
-
# by itself.
|
300
|
-
end
|
301
|
-
|
302
|
-
def init(ctx,rfuseconninfo)
|
303
|
-
print "RFuse TestFS started\n"
|
304
|
-
print "init called\n"
|
305
|
-
print "proto_major:#{rfuseconninfo.proto_major}\n"
|
306
|
-
end
|
307
|
-
|
308
|
-
end #class Fuse
|
309
|
-
|
310
|
-
RFuse.main(ARGV) { fs = MyFuse.new(MyDir.new("",0777)) }
|