|
2006-03-21
| ||
| 18:10 | • Ticket [823329ffff] glob -types type/creator/hidden not implemented on OSX s... artifact: 77d398a011 user: das | |
| 18:10 | • Closed ticket [823329ffff]. artifact: acf9206c28 user: das | |
| 00:31 | • Ticket [823329ffff]: 4 changes artifact: 44355e4ced user: nobody | |
|
2006-03-20
| ||
| 21:40 | • Ticket [823329ffff]: 1 change artifact: 5b3896c676 user: das | |
| 21:38 | • Ticket [823329ffff]: 4 changes artifact: 370b56d238 user: das | |
| 21:38 | • Add attachment 823329.diff to ticket [823329ffff] artifact: 1037789d52 user: das | |
| 21:38 | • Ticket [823329ffff] glob -types type/creator/hidden not implemented on OSX s... artifact: 84914b3e92 user: das | |
| 06:10 | • Ticket [823329ffff]: 5 changes artifact: 603d5ad09d user: vincentdarley | |
|
2003-10-14
| ||
| 19:10 | • Add attachment tclUnixFile.diff to ticket [823329ffff] artifact: 61dac15ad9 user: das | |
| 19:10 | • Ticket [823329ffff] glob -types type/creator/hidden not implemented on OSX s... artifact: f673cf6394 user: das | |
| 19:07 | • Ticket [823329ffff]: 4 changes artifact: 60cc76fc03 user: das | |
| 10:09 | • New ticket [823329ffff]. artifact: 506f8a60d5 user: vincentdarley | |
glob -types type/creator/hidden not implemented on OSX
Closed / Fixed823329ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 21 years ago
Descriptionplain2003-10-14 10:09:58
Commands like: glob -type TEXT * are not implemented on OS X. Since it is a version of MacOS, it is capable of supporting these things. Vince. Various comments below: On Tuesday, Oct 14, 2003, at 19:40 Australia/Sydney, Vince Darley wrote: > Should this just be #ifdef'd into NativeMatchType so it compiles on the > relevant platform, or...? I don't really understand all the vagaries > of > different unix systems so am probably not the person to implement > this... the creator/type code is #ifdef MAC_OSX_TCL so the same would be appropriate, c.f tclMacOSXFCmd.c [glob -types hidden] should be properly supported as well, that's also handled by TclMacOSXGetFileAttribute() and controlled by same #ifdef also [glob -types readonly] should be handled on unices that support CHFLAGS, c.f GetReadOnlyAttribute() in tclUnixFCmd.c, this is controlled by #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) > Also, by the time we're in NativeMatchType we actually only have a > native > path description (no Tcl_Obj) so we really want access to the innards > of > TclMacOSXGetFileAttribute. that's a bit of a pain, it kills code modularization for these functions... it wouldn't be hard to copy the guts out of TclMacOSXGetFileAttribute() and GetReadOnlyAttribute() into the unix NativeMatchType() but it doesn't seem to be very clean. maybe we need a native path aware versions of TclMacOSXGetFileAttribute/GetReadOnlyAttribute ? don't have much time to spend on this at the moment, maybe best to add a bug report on SF so that this doesn't get lost? we really should have thought about this when I did TIP 118...
dasplain2003-10-14 19:07:50
Logged In: YES user_id=90580 On Tuesday, Oct 14, 2003, at 19:56 Australia/Sydney, Daniel A. Steffen wrote: > On Tuesday, Oct 14, 2003, at 19:40 Australia/Sydney, Vince Darley > wrote: >> On Tue, 14 Oct 2003, Daniel A. Steffen wrote: >>> On Monday, Oct 13, 2003, at 21:38 Australia/Sydney, Vince Darley >>> wrote: >>> >>>> The 'NativeMatchType' in tcl/unix/tclUnixFile.c needs to be updated >>>> to >>>> (somehow) access the file type/creator when running on a compatible >>>> version of Unix (i.e. Darwin). >>> >>> it should be very easy to use the new TclMacOSXGetFileAttribute() >>> from >>> TIP118 for this. >> >> Should this just be #ifdef'd into NativeMatchType so it compiles on >> the >> relevant platform, or...? > > the creator/type code is #ifdef MAC_OSX_TCL so the same would be > appropriate, c.f tclMacOSXFCmd.c > > [glob -types hidden] should be properly supported as well, that's also > handled by TclMacOSXGetFileAttribute() and controlled by same #ifdef > > also [glob -types readonly] should be handled on unices that support > CHFLAGS, c.f GetReadOnlyAttribute() in tclUnixFCmd.c, this is > controlled by #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) as far as support for readonly goes, the 4 line patch below should do the trick, what do you think? this'll work on OSX and any BSD that has chflags this way [glob -type readonly] will find any files that have [file attribute -readonly] but also files that don't have any write perms (to preserve existing behaviour) >> Also, by the time we're in NativeMatchType we actually only have a >> native >> path description (no Tcl_Obj) so we really want access to the innards >> of >> TclMacOSXGetFileAttribute. > > that's a bit of a pain, it kills code modularization for these > functions... > > it wouldn't be hard to copy the guts out of > TclMacOSXGetFileAttribute() and GetReadOnlyAttribute() into the unix > NativeMatchType() but it doesn't seem to be very clean. maybe we need > a native path aware versions of > TclMacOSXGetFileAttribute/GetReadOnlyAttribute ? maybe better to make a TclMacOSXNativeMatchType() that checks for OSX specific possibilities like creator/type/hidden and put that into tclMacOSXFCmd.c and call it from the unix NativeMatchType()? That way platform specific FS code stays in tclMacOSXFCmd.c (and can potentially be shared via static functions).
dasplain2003-10-14 19:10:41
File Added - 64313: tclUnixFile.diff
vincentdarleyplain2006-03-20 06:10:33
Logged In: YES user_id=32170 Has this been implemented at any point? Vince.
dasplain2006-03-20 21:38:53
Logged In: YES user_id=90580 patch attached that implements this on HEAD. also fixes minor issue with pattern==NULL case of 'glob -types hidden' on unix ([glob -types hidden someFile] incorrectly returned 'someFile'). the only thing not implemented is exclusion of files hidden via HFS invisible flag from ordinary glob results (i.e. without -types hidden), to implement this it would be necessary to do always do a costly stat & getattrlist for every file traversed (as well as a major rewrite of unix TclpMatchInDirectory/ NativeMatchType), I don't think it's worth the slowdown of the most common glob cases to add this minor feature. [glob -types hidden] does however return the files with HFS invisible flag in addition to files starting with '.' will commit this tomorrow if I don't hear any objections.
dasplain2006-03-20 21:38:54
File Added - 171573: 823329.diff
das Ticket [823329ffff]: 1 change
[History diff]2006-03-20 21:40:47
nobodyplain2006-03-21 00:31:47
Logged In: NO Sounds v. good to me, including the 'invisible' trade-off. Vince.
dasplain2006-03-21 18:10:43
Logged In: YES
user_id=90580
patch committed to HEAD:
* generic/tclInt.decls: implement globbing for HFS creator & type
* macosx/tclMacOSXFCmd.c: codes and 'hidden' flag, as documented in
* tests/macOSXFCmd.test: glob.n; objectified OSType handling in [glob]
* unix/tclUnixFile.c: and [file attributes]; fix globbing for hidden
files with pattern==NULL arg. [Bug 823329]
* generic/tclIntPlatDecls.h:
* generic/tclStubInit.c: make genstubs
das Ticket [823329ffff]: 2 changes
[History diff]2006-03-21 18:10:44
Log in (anonymous is fine) to add a comment.
Attachments:
- 823329.diff [download] added by das on 2006-03-20 21:38:53. [details]
- tclUnixFile.diff [download] added by das on 2003-10-14 19:10:41. [details]