mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (plg_backend_local): folder nav issue
This commit is contained in:
parent
03daa29917
commit
a2c6d554fd
1 changed files with 13 additions and 1 deletions
|
|
@ -75,7 +75,19 @@ func (this Local) Ls(path string) ([]os.FileInfo, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this Local) Cat(path string) (io.ReadCloser, error) {
|
func (this Local) Cat(path string) (io.ReadCloser, error) {
|
||||||
return SafeOsOpenFile(path, os.O_RDONLY, os.ModePerm)
|
f, err := SafeOsOpenFile(path, os.O_RDONLY, os.ModePerm)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fs, err := f.Stat()
|
||||||
|
if err != nil {
|
||||||
|
f.Close()
|
||||||
|
return nil, err
|
||||||
|
} else if fs.IsDir() {
|
||||||
|
f.Close()
|
||||||
|
return nil, ErrNotFound
|
||||||
|
}
|
||||||
|
return f, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this Local) Mkdir(path string) error {
|
func (this Local) Mkdir(path string) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue