From: Vince Darley Date: Thu, 6 Sep 2001 18:08:49 +0000 (+0000) Subject: update for latest cvs X-Git-Tag: vfs-1-2~114 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=4bec98ac49e9f1fd068e3ebff8d95e055c166fb5;p=tclvfs update for latest cvs --- diff --git a/Readme.txt b/Readme.txt index 02c4a80..c7c2756 100644 --- a/Readme.txt +++ b/Readme.txt @@ -14,7 +14,7 @@ Since 8.4 is still in alpha, the APIs on which this extension depends may of course change. If that happens, it will of course require changes to this extension, until the point at which 8.4 goes final, when only backwards-compatible changes should occur. Currently it requires a version -of Tcl 8.4a4 or newer from September 5th 2001 or newer (if it compiles +of Tcl 8.4a4 or newer from September 7th 2001 or newer (if it compiles without warning, you should be fine). Using this extension, the editor Alphatk can actually auto-mount, view and @@ -24,8 +24,8 @@ do things like: file copy ftp://ftp.foo.com/pub/readme.txt . -With 'tkhtml', writing a web-browser in Tcl should be pretty trivial with -this extension. +With 'tkhtml' and this extension, writing a web-browser in Tcl should be +pretty trivial. None of the vfs's included are 100% complete or optimal yet, so if only for that reason, code contributions are very welcome. Many of them still diff --git a/generic/vfs.c b/generic/vfs.c index b41fc78..4df5ac3 100644 --- a/generic/vfs.c +++ b/generic/vfs.c @@ -241,11 +241,11 @@ VfsFilesystemObjCmd(dummy, interp, objc, objv) int index; static char *optionStrings[] = { - "info", "mount", "unmount", + "info", "mount", "unmount", "volumeschanged", NULL }; enum options { - VFS_INFO, VFS_MOUNT, VFS_UNMOUNT + VFS_INFO, VFS_MOUNT, VFS_UNMOUNT, VFS_VOLUMESCHANGED, }; if (objc < 2) { @@ -276,6 +276,7 @@ VfsFilesystemObjCmd(dummy, interp, objc, objv) TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY) == NULL) { return TCL_ERROR; } + Tcl_FSMountsChanged(&vfsFilesystem); break; } case VFS_INFO: { @@ -322,8 +323,18 @@ VfsFilesystemObjCmd(dummy, interp, objc, objv) path = Tcl_FSGetNormalizedPath(interp, objv[2]); res = Tcl_UnsetVar2(vfsInterp, "vfs::mount", Tcl_GetString(path), TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY); + if (res == TCL_OK) { + Tcl_FSMountsChanged(&vfsFilesystem); + } return res; } + case VFS_VOLUMESCHANGED: { + if (objc > 2) { + Tcl_WrongNumArgs(interp, 2, objv, NULL); + return TCL_ERROR; + } + Tcl_FSMountsChanged(&vfsFilesystem); + } } return TCL_OK; }