Artifacts Associated With Ticket 511658ffffffffffffffffffffffffffffffffff
Ticket change [2edc0fe89c] (rid 92955) by vincentdarley on 2002-02-01 11:10:01:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
(On Windows 2000sp2) % file attributes c:/ -archive 1 -hidden 1 -longname C:/ -readonly 0 - shortname C:/ -system 1 % file attributes D:/ -archive 1 -hidden 1 -longname D:/ -readonly 0 - shortname D:/ -system 1 % file attributes E:/ -archive 0 -hidden 0 -longname E:/ -readonly 0 - shortname E:/ -system 0 % file attributes c:/apps -archive 0 -hidden 0 -longname C:/Apps -readonly 0 - shortname C:/Apps -system 0 I would expect all of these to return 'hidden 0'. I have 3 partitions. 'c:' and 'd:' are NTFS and 'e:' is a FAT32 partition. It seems as if 'file attributes -hidden' returns the wrong value for NTFS partitions (but not for directories such as 'c:/apps' which are in NTFS partitions). Some quick debugging shows that: DWORD attr = (*tclWinProcs->getFileAttributesProc) (nativeName); returns 'attr = 54', where 'nativeName' is the native representation of 'c:/'. What is the right way to fix this? It turns out that this is also relevant to fixing another bug (which I'm working on offline), that both 'glob -types hidden c:/' and 'glob c:/' return the same thing. A fix is needed on line 1316 of tclWinFCmd.c (of latest cvs head). The bug exists in Tcl 8.3 as well (from which the above results were taken).
- foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "vincentdarley"
- subsystem initialized to: "37. File System"
- title initialized to: "'file attributes c:/' returns 'hidden 1'"
- type initialized to: "Bug"
Ticket change [e56d7c6eff] (rid 104117) by vincentdarley on 2002-02-01 19:53:49:
- icomment:
Logged In: YES user_id=32170 This appears to be a known problem/fact, e.g. http://www.macwindows.com/MacOS85.html contains "If you use the Win32 API GetFIleAttributes on the ROOT directory of an NTFS volume (for example, "e:\"), it always has the FILE_ATTRIBUTE_HIDDEN bit. However, if you use his same API against a subdirectory (say,"e:\myshare"), it will only have this bit set if someone set it.... I believe this is because NTFS uses these bits on the root directory to indicate that the file system is NTFS and not FAT." I'm not sure one can "hide" a root volume on windows, so perhaps what is needed is a check that the path is of the form 'x:/' (or x:\) and then to force the hidden flag to zero? anyone actually know anything about this?, beyond my speculation ;-)
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [9f3645621e] (rid 96599) by vincentdarley on 2002-02-05 22:51:10:
- icomment:
Logged In: YES user_id=32170 Using the following definition in tclWinFCmd.c should fix this: static int GetWinFileAttributes( Tcl_Interp *interp,/* The interp we are using for errors. */ int objIndex,/* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj **attributePtrPtr)/* A pointer to return the object with. */ { DWORD result; CONST TCHAR *nativeName; int attr; nativeName = Tcl_FSGetNativePath(fileName); result = (*tclWinProcs->getFileAttributesProc) (nativeName); if (result == 0xffffffff) { StatError(interp, fileName); return TCL_ERROR; } attr = (int)(result & attributeArray[objIndex]); if ((objIndex == WIN_HIDDEN_ATTRIBUTE) && (attr != 0)) { /* * It is hidden. However there is a bug on some Windows * OSes in which root volumes (drives) formatted as NTFS * are declared hidden when they are not (and cannot be). * * We test for, and fix that case, here. */ int len; char *str = Tcl_GetStringFromObj(fileName,&len); if (len < 4) { if (len == 0) { /* * Not sure if this is possible, but we pass it on * anyway */ } else if (len == 1 && (str[0] == '/' || str[0] == '\\')) { /* Path is pointing to the root volume */ attr = 0; } else if ((str[1] == ':') && (len == 2 || (str [2] == '/' || str[2] == '\\'))) { /* Path is of the form 'x:' or 'x:/' or 'x:\' */ attr = 0; } } } *attributePtrPtr = Tcl_NewBooleanObj(attr); return TCL_OK; } - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [76e9018ddc] (rid 105667) by vincentdarley on 2002-03-17 00:33:31:
- icomment:
Logged In: YES user_id=32170 fix included in fix to bug 511666
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [202e2d7e1b] (rid 91272) by vincentdarley on 2002-03-24 19:28:32:
- closedate changed to: "2002-03-24T12:28:32"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 fixed in cvs head.
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"