[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] File-extension



Hi Till -

.quote is probably slightly better than .escapeChar($ ) since the
string might have other weird things in like tabs or asterisks? (Yuck!
But it can happen.) Just a thought.

I'd be happy for these to be in core. Shame they won't work on
Windows, but I suppose they can be overridden.

Dan


2007/11/26, Till Bovermann <tboverma@xxxxxxxxxxxxxxxxxxxxxxxx>:
> Hey List,
>
> unsure where to put these (probably useful) extensions to file:
>
> + File {
>         *isRegularFile { arg pathName;
>                 ^("test -f %".format(pathName.escapeChar($ )).systemCmd == 0)
>         }
>         *isDirectory  { arg pathName;
>                 ^("test -d %".format(pathName.escapeChar($ )).systemCmd == 0)
>         }
>         *isRTFD {arg pathName;
>                 ^((pathName.splitext.last == "rtfd") && {this.isDirectory(pathName)})
>         }
> }
>
>
> Any Idea? std-distro / common quark, etc?
>
> regards
> Till
> _______________________________________________
> Sc-devel mailing list
> Sc-devel@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-devel
>


-- 
http://www.mcld.co.uk