[Top][All Lists]

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

Re: Shell commands in deleted directories

From: Antoine Levitt
Subject: Re: Shell commands in deleted directories
Date: Sun, 13 Feb 2011 22:21:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

13/02/11 22:07, Paul Eggert
> On 02/13/2011 01:02 PM, Antoine Levitt wrote:
>> +    /* If current_dir is unreachable (typically, does not exist), use
>> +       ~/ as default */
> This looks like a bad idea.  Suppose I run the shell
> command "rm *" in a deleted directory?
> The change would cause me to remove files in
> my home directory.  Better safe than sorry.

Mmh, true. But then again, if you're using "rm *" as a shell command
without being absolutely sure where you are, you're just asking for
trouble. But it's a valid point, and there might be other commands which
might have undesirable/confusing side effects when run from ~/. It might
even be a problem for the first test:

    current_dir = Funhandled_file_name_directory (current_dir);
    if (NILP (current_dir))
      /* If the file name handler says that current_dir is unreachable, use
         a sensible default. */
      current_dir = build_string ("~/");

I don't see how to resolve this, though.

reply via email to

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