summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authorashok <ashok>2016-07-09 08:27:00 (GMT)
committerashok <ashok>2016-07-09 08:27:00 (GMT)
commit8435bb9d68cdb26190ded1caca280eaac0314444 (patch)
treebdc4cefb1087197e872b1a580caeaba3bf124e84 /generic/tclCmdAH.c
parent8c040ee77b5cc022530f195ad1401b0a6762f931 (diff)
downloadtcl-8435bb9d68cdb26190ded1caca280eaac0314444.zip
tcl-8435bb9d68cdb26190ded1caca280eaac0314444.tar.gz
tcl-8435bb9d68cdb26190ded1caca280eaac0314444.tar.bz2
Bugfix [ae61a67192]. file {stat, type, size} etc. support for built-in special Windows files/devices like CON.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 54e0227..a53f1f7 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -1157,6 +1157,16 @@ FileAttrAccessTimeCmd(
if (GetStatBuf(interp, objv[1], Tcl_FSStat, &buf) != TCL_OK) {
return TCL_ERROR;
}
+#if defined(_WIN32)
+ /* We use a value of 0 to indicate the access time not available */
+ if (buf.st_atime == 0) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "could not get access time for file \"%s\"",
+ TclGetString(objv[1])));
+ return TCL_ERROR;
+ }
+#endif
+
if (objc == 3) {
/*
* Need separate variable for reading longs from an object on 64-bit
@@ -1229,6 +1239,15 @@ FileAttrModifyTimeCmd(
if (GetStatBuf(interp, objv[1], Tcl_FSStat, &buf) != TCL_OK) {
return TCL_ERROR;
}
+#if defined(_WIN32)
+ /* We use a value of 0 to indicate the modification time not available */
+ if (buf.st_mtime == 0) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "could not get modification time for file \"%s\"",
+ TclGetString(objv[1])));
+ return TCL_ERROR;
+ }
+#endif
if (objc == 3) {
/*
* Need separate variable for reading longs from an object on 64-bit