Artifacts Associated With Ticket 230474
Ticket change [d5f14fb0b2] (rid 123723) by vincentdarley on 2001-01-30 17:14:11:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
On Unix, 'glob' only returns the hidden/invisible files (matching .*) if the pattern starts with '.' -- i.e. if the user specifically requested them. On MacOS and Windows, in which invisibility is specified differently, hidden files are returned by default, even though the '-types hidden' option provides a mechanism to return them if they are desired. For consistency the MacOS and Windows versions of glob should be updated to follow the Unix example. Here's a patch for MacOS (tclMacFile.c should read): int typeOk = 1; if (types == NULL) { /* If invisible, don't return the file */ if (pb.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible) { typeOk = 0; } } else { if (pb.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible) { /* If invisible */ if ((types->perm == 0) || !(types->perm & TCL_GLOB_PERM_HIDDEN)) { typeOk = 0; } } else { /* Visible */ if ((types->perm == 0) || (types->perm & TCL_GLOB_PERM_HIDDEN)) { typeOk = 0; } } if (typeOk == 1 && types->perm != 0) { if ( ((types->perm & TCL_GLOB_PERM_RONLY) && !(pb.hFileInfo.ioFlAttrib & 1)) || ((types->perm & TCL_GLOB_PERM_R) && (TclpAccess(fname, R_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_W) && (TclpAccess(fname, W_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_X) && (TclpAccess(fname, X_OK) != 0)) ) { typeOk = 0; } } and for Windows (tclWinFile.c): int typeOk = 1; attr = (*tclWinProcs->getFileAttributesProc)(nativeName); if (types == NULL) { /* If invisible, don't return the file */ if (attr & FILE_ATTRIBUTE_HIDDEN) { typeOk = 0; } } else { if (attr & FILE_ATTRIBUTE_HIDDEN) { /* If invisible */ if ((types->perm == 0) || !(types->perm & TCL_GLOB_PERM_HIDDEN)) { typeOk = 0; } } else { /* Visible */ if ((types->perm == 0) || (types->perm & TCL_GLOB_PERM_HIDDEN)) { typeOk = 0; } } if (typeOk == 1 && types->perm != 0) { if ( ((types->perm & TCL_GLOB_PERM_RONLY) && !(attr & FILE_ATTRIBUTE_READONLY)) || ((types->perm & TCL_GLOB_PERM_R) && (TclpAccess(fname, R_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_W) && (TclpAccess(fname, W_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_X) && (TclpAccess(fname, X_OK) != 0)) ) { typeOk = 0; } } - foundin initialized to: "obsolete: 8.4a2"
- 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: "glob returns hidden files on win/macos"
- type initialized to: "Bug"
Ticket change [f8a16043b5] (rid 91574) by nobody on 2001-02-01 22:14:36:
- icomment:
Vince adds: the above patch isn't quite right; I have a correct one now, but there is one issue which ought to be resolved. On Unix hidden files are *defined* to be those beginning with '.', on MacOS hidden files are those which the OS has tagged as invisible. Tcl agrees with both these. However, on Windows hidden files are those the OS tags as invisible, but Tcl treats as invisible either those tagged by the OS or those beginning with '.' (at least according to the glob code). This inconsistency needs fixing. It is suggested that all special-casing of '.*' files be removed from the Windows version of glob, so that Tcl agrees with the native OS.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [41d894264b] (rid 116258) by dgp on 2001-04-14 02:18:38:
- subsystem changed to: "36. Pathname Management"
Ticket change [0e288b3d6b] (rid 94561) by vincentdarley on 2001-08-01 18:08:28:
- closedate changed to: "2001-08-01T11:08:28"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 One side-effect of TIP#17 is that this bug report of mine no longer applies.
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"