help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: (emacs+unix): How to have a file-name containing slashes, angle-bra


From: Xah
Subject: Re: (emacs+unix): How to have a file-name containing slashes, angle-brackets, etc?
Date: Sat, 23 Aug 2008 15:21:21 -0700 (PDT)
User-agent: G2/1.0

On Aug 15, 3:38 pm, dkco...@panix.com (David Combs) wrote:
> I'm downloading files of names like:
>
>      http://www.aaa.com/~john/foo-txt.htm
>
> Now, when I do this in a browser (I use lynx (shell-account))
> the default name to store it under is foo-txt.htm.
>
> Years later, what I'll want to know is exactly where it came from, ie
> I'd like the filename to depict the entire url.
>
> Like this, perhaps?
>
>      http://www.aaa.com/~john/foo-txt.htm
>
> Nope, because regardless of what the computer will
> make of it, it'll confuse *me* -- not knowing whether
> those slashes represent dir-separators within *my* computer,
> or in some far-away (maybe long dead) server.
>
> Hmmm.  Maybe "---" for "/"?
>
> What about ":"?
>
> And what about "~"?
>
> Plus other chars I've not thought of?
>
> Making it even longer, if the *title* of the report in
> the file is "10 easy editing tips", and I want that reflected
> in the name too.
>
>     Like 10-easy-editing-tips---http<colonSlashSlash>www.aaa.com... (you
>      get the idea).
>
> And, whatever we decide on, another question comes up -- how to ENTER
> that NAME into the computer -- both in emacs (dired) and in, say, tcsh.
>
> What, iva C-Q for emacs and ^V in unix.
>
> Suggestions?
>
> Thanks!
>
> David
>
> P.S.: Oh, I forgot.  tar shouldn't barf on the name.

what you want to do is pretty hopeless. Chars in url is confusing
enough, with its percent encoding, and when used in html as link,
there's also CDATA. Depending on the browser, or whatever tool you are
using, the url you get may or may not be processed to eliminate a
variety of encodings, and the encoding spec itself is not crystal
clear and in practice lots of actually invalid uri anyway...

chars in file names itself is also confusing. Different file systems
allow different char sets with different special char meanings, and
each generation of file system changes. (e.g. windows has “C:\\” and
“\” and if you are using cygwin you also get “/” ... mac has “:”
mostly in OS9, and “/” in OSX and there's complex char transform magic
underneath. Unix is the worst, they pretty much just allow
alphanumerics and not even space. If you have anything like “,=();
\'"~&-” etc, you can expect most shell tools to erase you disk)

the best thing to do is just to create a file like info.txt or
readme.txt or source.txt, then in that file put in the url, date, or
keywords and annotation. That's what i do.

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]