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
6db54109
Commit
6db54109
authored
May 20, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't create garbage in zipfs Stat().
parent
155e343e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
zipfs/memtree.go
zipfs/memtree.go
+2
-2
zipfs/tarfs.go
zipfs/tarfs.go
+9
-13
zipfs/zipfs.go
zipfs/zipfs.go
+3
-5
No files found.
zipfs/memtree.go
View file @
6db54109
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
)
)
type
MemFile
interface
{
type
MemFile
interface
{
Stat
(
)
*
fuse
.
Attr
Stat
(
out
*
fuse
.
Attr
)
Data
()
[]
byte
Data
()
[]
byte
}
}
...
@@ -94,7 +94,7 @@ func (n *memNode) GetAttr(out *fuse.Attr, file fuse.File, context *fuse.Context)
...
@@ -94,7 +94,7 @@ func (n *memNode) GetAttr(out *fuse.Attr, file fuse.File, context *fuse.Context)
out
.
Mode
=
fuse
.
S_IFDIR
|
0777
out
.
Mode
=
fuse
.
S_IFDIR
|
0777
return
fuse
.
OK
return
fuse
.
OK
}
}
*
out
=
*
n
.
file
.
Stat
(
)
n
.
file
.
Stat
(
out
)
return
fuse
.
OK
return
fuse
.
OK
}
}
...
...
zipfs/tarfs.go
View file @
6db54109
...
@@ -17,15 +17,12 @@ var _ = fmt.Println
...
@@ -17,15 +17,12 @@ var _ = fmt.Println
// TODO - handle symlinks.
// TODO - handle symlinks.
func
HeaderToFileInfo
(
h
*
tar
.
Header
)
(
*
fuse
.
Attr
,
string
)
{
func
HeaderToFileInfo
(
out
*
fuse
.
Attr
,
h
*
tar
.
Header
)
{
a
:=
&
fuse
.
Attr
{
out
.
Mode
=
uint32
(
h
.
Mode
)
Mode
:
uint32
(
h
.
Mode
),
out
.
Size
=
uint64
(
h
.
Size
)
Size
:
uint64
(
h
.
Size
),
out
.
Uid
=
uint32
(
h
.
Uid
)
}
out
.
Gid
=
uint32
(
h
.
Gid
)
a
.
Uid
=
uint32
(
h
.
Uid
)
out
.
SetTimes
(
&
h
.
AccessTime
,
&
h
.
ModTime
,
&
h
.
ChangeTime
)
a
.
Gid
=
uint32
(
h
.
Gid
)
a
.
SetTimes
(
&
h
.
AccessTime
,
&
h
.
ModTime
,
&
h
.
ChangeTime
)
return
a
,
h
.
Name
}
}
type
TarFile
struct
{
type
TarFile
struct
{
...
@@ -33,10 +30,9 @@ type TarFile struct {
...
@@ -33,10 +30,9 @@ type TarFile struct {
tar
.
Header
tar
.
Header
}
}
func
(
f
*
TarFile
)
Stat
()
*
fuse
.
Attr
{
func
(
f
*
TarFile
)
Stat
(
out
*
fuse
.
Attr
)
{
fi
,
_
:=
HeaderToFileInfo
(
&
f
.
Header
)
HeaderToFileInfo
(
out
,
&
f
.
Header
)
fi
.
Mode
|=
syscall
.
S_IFREG
out
.
Mode
|=
syscall
.
S_IFREG
return
fi
}
}
func
(
f
*
TarFile
)
Data
()
[]
byte
{
func
(
f
*
TarFile
)
Data
()
[]
byte
{
...
...
zipfs/zipfs.go
View file @
6db54109
...
@@ -19,12 +19,10 @@ type ZipFile struct {
...
@@ -19,12 +19,10 @@ type ZipFile struct {
*
zip
.
File
*
zip
.
File
}
}
func
(
f
*
ZipFile
)
Stat
(
)
*
fuse
.
Attr
{
func
(
f
*
ZipFile
)
Stat
(
out
*
fuse
.
Attr
)
{
// TODO - do something intelligent with timestamps.
// TODO - do something intelligent with timestamps.
return
&
fuse
.
Attr
{
out
.
Mode
=
fuse
.
S_IFREG
|
0444
Mode
:
fuse
.
S_IFREG
|
0444
,
out
.
Size
=
uint64
(
f
.
File
.
UncompressedSize
)
Size
:
uint64
(
f
.
File
.
UncompressedSize
),
}
}
}
func
(
f
*
ZipFile
)
Data
()
[]
byte
{
func
(
f
*
ZipFile
)
Data
()
[]
byte
{
...
...
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