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
Levin Zimmermann
go-fuse
Commits
6dbddc38
Commit
6dbddc38
authored
Apr 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ZipFileFuse to ZipArchiveFileSystem.
parent
0cccae24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
zipfs/multizip.go
zipfs/multizip.go
+3
-3
zipfs/zipfs.go
zipfs/zipfs.go
+7
-7
No files found.
zipfs/multizip.go
View file @
6dbddc38
...
...
@@ -45,7 +45,7 @@ func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, f
fs
:=
NewZipArchiveFileSystem
(
zipFile
)
if
fs
==
nil
{
// TODO
log
.
Println
(
"NewZip
FileFuse
returned nil"
)
log
.
Println
(
"NewZip
ArchiveFileSystem
returned nil"
)
me
.
zfs
.
pendingZips
[
me
.
Basename
]
=
false
,
false
return
0
,
fuse
.
ENOSYS
}
...
...
@@ -73,7 +73,7 @@ func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, f
type
MultiZipFs
struct
{
Connector
*
fuse
.
PathFileSystemConnector
lock
sync
.
RWMutex
zips
map
[
string
]
*
Zip
FileFuse
zips
map
[
string
]
*
Zip
ArchiveFileSystem
pendingZips
map
[
string
]
bool
zipFileNames
map
[
string
]
string
...
...
@@ -82,7 +82,7 @@ type MultiZipFs struct {
func
NewMultiZipFs
()
*
MultiZipFs
{
m
:=
new
(
MultiZipFs
)
m
.
zips
=
make
(
map
[
string
]
*
Zip
FileFuse
)
m
.
zips
=
make
(
map
[
string
]
*
Zip
ArchiveFileSystem
)
m
.
pendingZips
=
make
(
map
[
string
]
bool
)
m
.
zipFileNames
=
make
(
map
[
string
]
string
)
m
.
Connector
=
fuse
.
NewPathFileSystemConnector
(
m
)
...
...
zipfs/zipfs.go
View file @
6dbddc38
...
...
@@ -70,7 +70,7 @@ func (me *ZipDirTree) FindDir(name string) *ZipDirTree {
return
s
}
type
Zip
FileFuse
struct
{
type
Zip
ArchiveFileSystem
struct
{
zipReader
*
zip
.
ReadCloser
tree
*
ZipDirTree
ZipFileName
string
...
...
@@ -100,12 +100,12 @@ func zipFilesToTree(files []*zip.File) *ZipDirTree {
return
t
}
func
NewZipArchiveFileSystem
(
name
string
)
*
Zip
FileFuse
{
z
:=
new
(
Zip
FileFuse
)
func
NewZipArchiveFileSystem
(
name
string
)
*
Zip
ArchiveFileSystem
{
z
:=
new
(
Zip
ArchiveFileSystem
)
r
,
err
:=
zip
.
OpenReader
(
name
)
if
err
!=
nil
{
// TODO - return os.Error instead.
log
.
Println
(
"NewZip
FileFuse
(): "
+
err
.
String
())
log
.
Println
(
"NewZip
ArchiveFileSystem
(): "
+
err
.
String
())
return
nil
}
z
.
ZipFileName
=
name
...
...
@@ -117,7 +117,7 @@ func NewZipArchiveFileSystem(name string) *ZipFileFuse {
const
zip_DIRMODE
uint32
=
fuse
.
S_IFDIR
|
0700
const
zip_FILEMODE
uint32
=
fuse
.
S_IFREG
|
0600
func
(
me
*
Zip
FileFuse
)
GetAttr
(
name
string
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
func
(
me
*
Zip
ArchiveFileSystem
)
GetAttr
(
name
string
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
dir
,
file
:=
me
.
tree
.
Lookup
(
name
)
if
dir
==
nil
{
return
nil
,
fuse
.
ENOENT
...
...
@@ -135,7 +135,7 @@ func (me *ZipFileFuse) GetAttr(name string) (*fuse.Attr, fuse.Status) {
return
a
,
fuse
.
OK
}
func
(
me
*
Zip
FileFuse
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
func
(
me
*
Zip
ArchiveFileSystem
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
...
...
@@ -147,7 +147,7 @@ func (me *ZipFileFuse) Open(name string, flags uint32) (file fuse.FuseFile, code
return
NewZipFile
(
zfile
),
fuse
.
OK
}
func
(
me
*
Zip
FileFuse
)
OpenDir
(
name
string
)
(
stream
chan
fuse
.
DirEntry
,
code
fuse
.
Status
)
{
func
(
me
*
Zip
ArchiveFileSystem
)
OpenDir
(
name
string
)
(
stream
chan
fuse
.
DirEntry
,
code
fuse
.
Status
)
{
zdir
,
file
:=
me
.
tree
.
Lookup
(
name
)
if
file
!=
nil
{
return
nil
,
fuse
.
ENOSYS
...
...
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