|
From: SourceForge.net <no...@so...> - 2013-03-18 13:03:28
|
Bugs item #3608360, was opened at 2013-03-18 01:28 Message generated for change (Comment added) made by nijtmans You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3608360&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 16. Commands A-H Group: current: 8.6.0 >Status: Pending >Resolution: Invalid Priority: 8 Private: No Submitted By: Uwe Schmitz (schmitzu) Assigned to: Jan Nijtmans (nijtmans) Summary: Incompatible behaviour of "file exists" Initial Comment: There is an incompatibilty concerning "file exists" in 8.6: % puts $tcl_patchLevel 8.6.0 % glob * x.tcl % file exists *.tcl 1 Whereas in 8.5: % puts $tcl_patchLevel 8.5.12 % glob * x.tcl % file exists *.tcl 0 platform: Win7_x64, tcl-binaries: ActiveState. This breaks backward compatibility. ---------------------------------------------------------------------- >Comment By: Jan Nijtmans (nijtmans) Date: 2013-03-18 06:03 Message: On UNIX (actually Cygwin): $ tclsh8.5 % puts $tcl_patchLevel 8.5.13 % glob *.tcl x.tcl % file exists *.tcl 0 $ tclsh8.6 % puts $tcl_patchLevel 8.6.0 % glob *.tcl x.tcl % file exists *.tcl 0 % exit Conclusion: the fact that using the '*' character this way in [file exists] worked at all in win32 was an undocumented feature and is non-portable. On UNIX, the '*' character can be used in filenames like any other character, only it must be escaped if the filename goes through a shell. ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2013-03-18 03:55 Message: I will have a look. Thanks! ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2013-03-18 02:59 Message: Definitely a problem in implementation of NativeAccess() in tclWinFile.c (the generic layers over that do the right thing) but I really don't know the relevant API. Is this related to 2893771? (Committed on 2009-11-24 in https://core.tcl.tk/tcl/info/02224b9ef68c so it fits with being an 8.6.* issue.) We're feeding a filename into FindFirstFile which is the directory entry enumerator, which in turn is the only thing that can do that sort of thing with a glob patter AIUI. My knowledge of the deep ins-and-outs of Win32 is too small for me to go further. Assigning to someone who knows more about the relevant bits than me. Perhaps just testing for glob metacharacters in the name would be enough? I vaguely remember them as being always forbidden in filenames... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3608360&group_id=10894 |