Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go-fuse
Commits
11e662a2
Commit
11e662a2
authored
Sep 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ReadOnlyFile to DataFile.
parent
9a8313a9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
12 deletions
+12
-12
example/hello/hello.go
example/hello/hello.go
+2
-2
fuse/cache_test.go
fuse/cache_test.go
+1
-1
fuse/files.go
fuse/files.go
+5
-5
fuse/notify_test.go
fuse/notify_test.go
+1
-1
fuse/pathdebug.go
fuse/pathdebug.go
+1
-1
unionfs/autounion.go
unionfs/autounion.go
+1
-1
zipfs/memtree.go
zipfs/memtree.go
+1
-1
No files found.
example/hello/hello.go
View file @
11e662a2
// A Go mirror of libfuse's hello.c
// A Go mirror of libfuse's hello.c
package
main
...
...
@@ -44,7 +44,7 @@ func (me *HelloFs) Open(name string, flags uint32, context *fuse.Context) (file
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
return
fuse
.
New
ReadOnly
File
([]
byte
(
name
)),
fuse
.
OK
return
fuse
.
New
Data
File
([]
byte
(
name
)),
fuse
.
OK
}
func
main
()
{
...
...
fuse/cache_test.go
View file @
11e662a2
...
...
@@ -106,7 +106,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile
}
data
:=
bytes
.
Repeat
([]
byte
{
42
},
me
.
Length
)
f
:=
New
ReadOnly
File
(
data
)
f
:=
New
Data
File
(
data
)
return
&
WithFlags
{
File
:
f
,
FuseFlags
:
FOPEN_NONSEEKABLE
,
...
...
fuse/files.go
View file @
11e662a2
...
...
@@ -8,21 +8,21 @@ import (
var
_
=
fmt
.
Println
//
ReadOnly
File is for implementing read-only filesystems. This
//
Data
File is for implementing read-only filesystems. This
// assumes we already have the data in memory.
type
ReadOnly
File
struct
{
type
Data
File
struct
{
data
[]
byte
DefaultFile
}
func
New
ReadOnlyFile
(
data
[]
byte
)
*
ReadOnly
File
{
f
:=
new
(
ReadOnly
File
)
func
New
DataFile
(
data
[]
byte
)
*
Data
File
{
f
:=
new
(
Data
File
)
f
.
data
=
data
return
f
}
func
(
me
*
ReadOnly
File
)
Read
(
input
*
ReadIn
,
bp
BufferPool
)
([]
byte
,
Status
)
{
func
(
me
*
Data
File
)
Read
(
input
*
ReadIn
,
bp
BufferPool
)
([]
byte
,
Status
)
{
end
:=
int
(
input
.
Offset
)
+
int
(
input
.
Size
)
if
end
>
len
(
me
.
data
)
{
end
=
len
(
me
.
data
)
...
...
fuse/notify_test.go
View file @
11e662a2
...
...
@@ -28,7 +28,7 @@ func (me *NotifyFs) GetAttr(name string, context *Context) (*os.FileInfo, Status
}
func
(
me
*
NotifyFs
)
Open
(
name
string
,
f
uint32
,
context
*
Context
)
(
File
,
Status
)
{
return
New
ReadOnly
File
([]
byte
{
42
}),
OK
return
New
Data
File
([]
byte
{
42
}),
OK
}
type
NotifyTest
struct
{
...
...
fuse/pathdebug.go
View file @
11e662a2
...
...
@@ -45,7 +45,7 @@ func (me *FileSystemDebug) Add(name string, callback getter) {
func
(
me
*
FileSystemDebug
)
Open
(
path
string
,
flags
uint32
,
context
*
Context
)
(
fuseFile
File
,
status
Status
)
{
content
:=
me
.
getContent
(
path
)
if
content
!=
nil
{
return
New
ReadOnly
File
(
content
),
OK
return
New
Data
File
(
content
),
OK
}
return
me
.
FileSystem
.
Open
(
path
,
flags
,
context
)
}
...
...
unionfs/autounion.go
View file @
11e662a2
...
...
@@ -322,7 +322,7 @@ func (me *AutoUnionFs) Open(path string, flags uint32, context *fuse.Context) (f
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
return
fuse
.
New
ReadOnly
File
([]
byte
(
fuse
.
Version
())),
fuse
.
OK
return
fuse
.
New
Data
File
([]
byte
(
fuse
.
Version
())),
fuse
.
OK
}
if
path
==
filepath
.
Join
(
_CONFIG
,
_SCAN_CONFIG
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
...
...
zipfs/memtree.go
View file @
11e662a2
...
...
@@ -89,7 +89,7 @@ func (me *memNode) Open(flags uint32, context *fuse.Context) (fuseFile fuse.File
return
nil
,
fuse
.
EPERM
}
return
fuse
.
New
ReadOnly
File
(
me
.
file
.
Data
()),
fuse
.
OK
return
fuse
.
New
Data
File
(
me
.
file
.
Data
()),
fuse
.
OK
}
func
(
me
*
memNode
)
GetAttr
(
file
fuse
.
File
,
context
*
fuse
.
Context
)
(
*
os
.
FileInfo
,
fuse
.
Status
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment