Commit 6dbddc38 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Rename ZipFileFuse to ZipArchiveFileSystem.

parent 0cccae24
......@@ -45,7 +45,7 @@ func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, f
fs := NewZipArchiveFileSystem(zipFile)
if fs == nil {
// TODO
log.Println("NewZipFileFuse returned nil")
log.Println("NewZipArchiveFileSystem 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]*ZipFileFuse
zips map[string]*ZipArchiveFileSystem
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]*ZipFileFuse)
m.zips = make(map[string]*ZipArchiveFileSystem)
m.pendingZips = make(map[string]bool)
m.zipFileNames = make(map[string]string)
m.Connector = fuse.NewPathFileSystemConnector(m)
......
......@@ -70,7 +70,7 @@ func (me *ZipDirTree) FindDir(name string) *ZipDirTree {
return s
}
type ZipFileFuse struct {
type ZipArchiveFileSystem struct {
zipReader *zip.ReadCloser
tree *ZipDirTree
ZipFileName string
......@@ -100,12 +100,12 @@ func zipFilesToTree(files []*zip.File) *ZipDirTree {
return t
}
func NewZipArchiveFileSystem(name string) *ZipFileFuse {
z := new(ZipFileFuse)
func NewZipArchiveFileSystem(name string) *ZipArchiveFileSystem {
z := new(ZipArchiveFileSystem)
r, err := zip.OpenReader(name)
if err != nil {
// TODO - return os.Error instead.
log.Println("NewZipFileFuse(): " + err.String())
log.Println("NewZipArchiveFileSystem(): " + 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 *ZipFileFuse) GetAttr(name string) (*fuse.Attr, fuse.Status) {
func (me *ZipArchiveFileSystem) 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 *ZipFileFuse) Open(name string, flags uint32) (file fuse.FuseFile, code fuse.Status) {
func (me *ZipArchiveFileSystem) 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 *ZipFileFuse) OpenDir(name string) (stream chan fuse.DirEntry, code fuse.Status) {
func (me *ZipArchiveFileSystem) OpenDir(name string) (stream chan fuse.DirEntry, code fuse.Status) {
zdir, file := me.tree.Lookup(name)
if file != nil {
return nil, fuse.ENOSYS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment