From 6305cf159e339cb8f19aa7e52fd2f810d2ab67fc Mon Sep 17 00:00:00 2001 From: timurgordon Date: Tue, 18 Feb 2025 05:22:38 +0300 Subject: [PATCH] small fixes on example --- examples/vfs/example.vsh | 10 +++++----- lib/vfs/vfsnested/vfsnested.v | 4 ++-- lib/vfs/vfsourdb/vfsourdb.v | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/vfs/example.vsh b/examples/vfs/example.vsh index 635aa392..da81bc95 100755 --- a/examples/vfs/example.vsh +++ b/examples/vfs/example.vsh @@ -2,15 +2,15 @@ import freeflowuniverse.herolib.vfs.webdav import freeflowuniverse.herolib.vfs.vfsnested -import freeflowuniverse.herolib.vfs.ourdb_fs import freeflowuniverse.herolib.vfs.vfscore +import freeflowuniverse.herolib.vfs.vfsourdb mut high_level_vfs := vfsnested.new() // lower level VFS Implementations that use OurDB -mut vfs1 := vfscore.new_local_vfs('/tmp/test_webdav_ourdbvfs/vfs1')! -mut vfs2 := vfscore.new_local_vfs('/tmp/test_webdav_ourdbvfs/vfs2')! -mut vfs3 := vfscore.new_local_vfs('/tmp/test_webdav_ourdbvfs/vfs3')! +mut vfs1 := vfsourdb.new('/tmp/test_webdav_ourdbvfs/vfs1', '/tmp/test_webdav_ourdbvfs/vfs1')! +mut vfs2 := vfsourdb.new('/tmp/test_webdav_ourdbvfs/vfs2', '/tmp/test_webdav_ourdbvfs/vfs2')! +mut vfs3 := vfsourdb.new('/tmp/test_webdav_ourdbvfs/vfs3', '/tmp/test_webdav_ourdbvfs/vfs3')! // Nest OurDB VFS instances at different paths high_level_vfs.add_vfs('/data', vfs1) or { panic(err) } @@ -20,4 +20,4 @@ high_level_vfs.add_vfs('/data/backup', vfs3) or { panic(err) } // Nested under / // Create WebDAV Server that uses high level VFS webdav_server := webdav.new_app( vfs: high_level_vfs -) +)! diff --git a/lib/vfs/vfsnested/vfsnested.v b/lib/vfs/vfsnested/vfsnested.v index 00953dc8..f93efcf7 100644 --- a/lib/vfs/vfsnested/vfsnested.v +++ b/lib/vfs/vfsnested/vfsnested.v @@ -111,8 +111,8 @@ pub fn (mut self NestedVFS) dir_delete(path string) ! { return impl.dir_delete(rel_path) } -pub fn (mut self NestedVFS) exists(path string) !bool { - mut impl, rel_path := self.find_vfs(path)! +pub fn (mut self NestedVFS) exists(path string) bool { + mut impl, rel_path := self.find_vfs(path) or {return false} return impl.exists(rel_path) } diff --git a/lib/vfs/vfsourdb/vfsourdb.v b/lib/vfs/vfsourdb/vfsourdb.v index 56b13e2d..a29a3760 100644 --- a/lib/vfs/vfsourdb/vfsourdb.v +++ b/lib/vfs/vfsourdb/vfsourdb.v @@ -96,7 +96,7 @@ pub fn (mut self OurDBVFS) dir_delete(path string) ! { parent_dir.rm(dir_name)! } -pub fn (mut self OurDBVFS) exists(path string) !bool { +pub fn (mut self OurDBVFS) exists(path string) bool { if path == '/' { return true }