ShallowDirectory builds an empty dir which will be used to unmarshal data in it
(f *Fs, remote string)
| 36 | |
| 37 | // ShallowDirectory builds an empty dir which will be used to unmarshal data in it |
| 38 | func ShallowDirectory(f *Fs, remote string) *Directory { |
| 39 | var cd *Directory |
| 40 | fullRemote := cleanPath(path.Join(f.Root(), remote)) |
| 41 | |
| 42 | // build a new one |
| 43 | dir := cleanPath(path.Dir(fullRemote)) |
| 44 | name := cleanPath(path.Base(fullRemote)) |
| 45 | cd = &Directory{ |
| 46 | CacheFs: f, |
| 47 | Name: name, |
| 48 | Dir: dir, |
| 49 | CacheModTime: time.Now().UnixNano(), |
| 50 | CacheSize: 0, |
| 51 | CacheItems: 0, |
| 52 | CacheType: "Directory", |
| 53 | } |
| 54 | |
| 55 | return cd |
| 56 | } |
| 57 | |
| 58 | // DirectoryFromOriginal builds one from a generic fs.Directory |
| 59 | func DirectoryFromOriginal(ctx context.Context, f *Fs, d fs.Directory) *Directory { |