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
9636c970
Commit
9636c970
authored
Mar 22, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: add more comments in zipfs
parent
d1c9d5a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
nodefs/zip_test.go
nodefs/zip_test.go
+5
-5
No files found.
nodefs/zip_test.go
View file @
9636c970
...
@@ -109,7 +109,7 @@ func TestZipFS(t *testing.T) {
...
@@ -109,7 +109,7 @@ func TestZipFS(t *testing.T) {
}
}
}
}
// zipFile is a file read from a zip
fil
e.
// zipFile is a file read from a zip
archiv
e.
type
zipFile
struct
{
type
zipFile
struct
{
DefaultOperations
DefaultOperations
file
*
zip
.
File
file
*
zip
.
File
...
@@ -145,12 +145,12 @@ func (zf *zipFile) Open(ctx context.Context, flags uint32) (FileHandle, uint32,
...
@@ -145,12 +145,12 @@ func (zf *zipFile) Open(ctx context.Context, flags uint32) (FileHandle, uint32,
}
}
// We don't return a filehandle since we don't really need
// We don't return a filehandle since we don't really need
// one.
// one. The file content is immutable, so hint the kernel to
return
nil
,
0
,
fuse
.
OK
// cache the data.
return
nil
,
fuse
.
FOPEN_KEEP_CACHE
,
fuse
.
OK
}
}
// Read sets the minimum, which is the size. A more full-featured
// Read simply returns the data that was already unpacked in the Open call
// FS would also set timestamps and permissions.
func
(
zf
*
zipFile
)
Read
(
ctx
context
.
Context
,
f
FileHandle
,
dest
[]
byte
,
off
int64
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
func
(
zf
*
zipFile
)
Read
(
ctx
context
.
Context
,
f
FileHandle
,
dest
[]
byte
,
off
int64
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
end
:=
int
(
off
)
+
len
(
dest
)
end
:=
int
(
off
)
+
len
(
dest
)
if
end
>
len
(
zf
.
data
)
{
if
end
>
len
(
zf
.
data
)
{
...
...
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