[DGD] get_dir() oddity

bart at wotf.org bart at wotf.org
Thu Dec 20 22:38:32 CET 2007


On Thu, 20 Dec 2007 14:11:28 -0600, Erwin Harte wrote
> Sure you can.  Read The F* Manual :)

Heh.

> 
>        ?       any single character
>        *       any (possibly empty) string
>        [a-z]   any character in the range a-z
>        [^a-z]  any character not in range a-z
> =>    \c      the character c, not interpreted as having a special
>                meaning
> 
> The gotcha is that to insert an actual \ into a string in LPC you 
> need to double it, so this won't do you any good:

And indeed get_dir("/cmd/comm/\\[@.c") returns the result desired, so 2 ways
to get around the issue. Indeed not very helpful for me, but good to know. I
still really don't like the fact that filenames that work for everything else
need special treatment when used with get_dir(). For things like getting
timestamp of a file, or checking if it exists at all, it seems a bit expensive
also to have to check on this and do the proper escaping in LPC.

At any rate, thanks for the clarification, and yeah, I really should dive into
the documentation a bit again :)

Bart.
--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/



More information about the DGD mailing list