summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-10-01 16:58:59 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-10-01 16:58:59 (GMT)
commit681022822bad59620701b978831cd95e25b9e21f (patch)
tree17823f19a95730596c40aac4cb8766587fbb1144 /generic/tclIOUtil.c
parent5763cd3970d32d646f7a798a69196e70743375b5 (diff)
downloadtcl-681022822bad59620701b978831cd95e25b9e21f.zip
tcl-681022822bad59620701b978831cd95e25b9e21f.tar.gz
tcl-681022822bad59620701b978831cd95e25b9e21f.tar.bz2
More file ensemble tests for zipfs
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 7bbb9cd..c74eb00 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -4315,11 +4315,17 @@ Tcl_FSDeleteFile(
Tcl_Obj *pathPtr) /* Pathname of file to be removed (UTF-8). */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
-
- if (fsPtr != NULL && fsPtr->deleteFileProc != NULL) {
- return fsPtr->deleteFileProc(pathPtr);
+ int err;
+
+ if (fsPtr == NULL) {
+ err = ENOENT;
+ } else {
+ if (fsPtr->deleteFileProc != NULL) {
+ return fsPtr->deleteFileProc(pathPtr);
+ }
+ err = ENOTSUP;
}
- Tcl_SetErrno(ENOENT);
+ Tcl_SetErrno(err);
return -1;
}
@@ -4437,10 +4443,14 @@ Tcl_FSRemoveDirectory(
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
- if (fsPtr == NULL || fsPtr->removeDirectoryProc == NULL) {
+ if (fsPtr == NULL) {
Tcl_SetErrno(ENOENT);
return -1;
}
+ if (fsPtr->removeDirectoryProc == NULL) {
+ Tcl_SetErrno(ENOTSUP);
+ return -1;
+ }
if (recursive) {
Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL);