-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At some point hitherto, Michael O'Donnell hath spake thusly:
> ...and given that my WWW server is willing to serve
> all such files mentioned in that fileList as long as
> they're mentioned properly, is there a canned method
> of converting that fileList into a list of names with
> all troublesome characters properly escaped?

I'm not aware of any such pre-existing can (though there probably is
one), but you could fairly easily roll your own.  The ASCII characters
[A-Za-z0-9_] should be considered safe, and (though some other
characters are also fine, I'm not entirely sure what they all are)
IIRC the rest you should probably convert into a '%' followed by the
two-digit hex ASCII code for the character.  So for example, space
becomes %20 in your URL.

If I had a program that did this already, and it were called frob,
what I would do would be to use it in a pipe, like this:

  find dirname | frob | sed 's~^~http://servername~'

or maybe 

  find dirname | frob | sed 's~^~file://~

Note that -print is the default action for find, and is never needed,
except on some very old variants of Unix.  Note also that you can't
use the typical '/' character as the separator in sed's switch because
the string you're switching the beginning of the line to contains it.
Fortunately, sed can use almost any character as the separator.  The
most common substitute that I've seen is '~' in switch expressions.
IIRC you can use any character that is not contained in the rest of
the expression, except for the ';' and whitespace characters.  But I'm
not positive on that.

- -- 
Derek Martin               [EMAIL PROTECTED]    
- ---------------------------------------------
I prefer mail encrypted with PGP/GPG!
GnuPG Key ID: 0x81CFE75D
Retrieve my public key at http://pgp.mit.edu
Learn more about it at http://www.gnupg.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8pfq2djdlQoHP510RAvOrAJ4r76fV3NjDKlnH91icd7uqyAEphACglknK
XtEwjlMjy/oJgeCeH69jTRo=
=onXc
-----END PGP SIGNATURE-----

*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to