Re: [glob -tails] broken in respect to tilde-filenames!

From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 03/08/04


Date: 08 Mar 2004 11:56:37 GMT

Zoran Vasiljevic <zoran@archiware.com> wrote:
> I do understand your point. The thing is only: what is more dangerous?
> Displaying a "./" in front of tilde-files or accidentaly deleting
> user home-directory?

Your forgot two points:
  - glob is not the only thinkable source of filenames that might start
        with a tilde. You'd also have to prepend ./ to every entry-
        widget, to gets (it might read some filename from a channel)...
        See the point?
  if glob returned "safe" filenames, then in every case where these
        filenames get presented to the user, the programmer would need
        to remove the prefix. (users generally cannot handle a leading
        "./". They would see it as a bug or complain that they don't
        find/recognize their file in the list!) And after the prefix
        is removed, we're back at current state.
  The start of the file-manpage does mention tilde-substitution and
        refers to the manpage for filename for exact description on
        how tilde-substitution exactly works.

Even if no code-change emerges from this thread, it might be a nice move
to add a reminder to the description of [file delete] (being the most
dangerous of all file-subcommands) about tilde-substitution.

That [file split] actually does this automatic "./"-prepending might
be the reason, that made the OP first point to [glob] as point of
trouble (since glob behaves differently than [file split]).



Relevant Pages

  • Re: tclhttpd with utf-8
    ... it changed the data format from the non utf-8 format (that I was ... translation binary suppose to skip encoding translation? ... The problem is most likely the [glob] command, ... the filenames that cause trouble, then run your tclsh script with the ...
    (comp.lang.tcl)
  • Dumb glob question
    ... I've run into an issue with glob and matching filenames with brackets '' ...
    (comp.lang.python)
  • Re: Problem with glob and filenames containing [ and ]
    ... I'm having trouble using glob to find filenames that contain '[' and ... even though I am escaping those meta-characters. ... characters that are meta in glob; ... @CandidateOrigFiles: ...
    (comp.lang.perl.misc)
  • Re: A globbing question
    ... I'm trying to figure out how to "glob" lists instead of the current ... This fragment will print all the filenames started with 'a' in the ...
    (comp.lang.perl.misc)
  • Problem with glob and filenames containing [ and ]
    ... I'm having trouble using glob to find filenames that contain '[' and ... script and output: ... characters that are meta in glob; ... @CandidateOrigFiles: ...
    (comp.lang.perl.misc)