Overview
| Artifact ID: | 60cc76fc03ace8869e44689386b40daf570bb01e |
|---|---|
| Ticket: | 823329ffffffffffffffffffffffffffffffffff
glob -types type/creator/hidden not implemented on OSX |
| User & Date: | das on 2003-10-14 19:07:50 |
Changes
- icomment:
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).
- login: "das"
- mimetype: "text/plain"
- username: "das"