[Top][All Lists]

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

Re: [Emacs-diffs] trunk r116230: Fix bug #16558 with w32-shell-execute o

From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r116230: Fix bug #16558 with w32-shell-execute on remote file names.
Date: Sun, 02 Feb 2014 21:33:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Btw, find-file-name-handler returns nil for file-exists-p when the
> file name specifies a compressed file, so I'm not sure what bothered
> you in the first place.

Ha!  Indeed, I had never noticed that `operations' property!
Then I guess the current code is OK (tho it's still kind of a hack).

>> And the reason we do that is because some file names are "normal" and
>> others refer to non-files according to some w32 feature which can map
>> them to some other tools.
> The reason is described in the comment: if the file name is not
> absolute and its name is not relative to the directory passed to the
> system API, the API will fail.

I'm having trouble understanding the above: can you give an example of
a file which is neither absolute nor relative to the directory passed
to the system API?

>> I don't know that w32 feature at all, so it's hard for me to figure out
>> what should be done, but it seems like file-exists-p is not the right
>> thing to do anyway since the file name might be "normal" but refer to
>> a file that doesn't exist yet.
> Yes, that might happen, but then the file will be created in a
> directory other than what the user expects it to, perhaps.

So it would be a problem, right?

Maybe instead of Ffile_exists_p a better option is to use a w32 system
call along the lines of faccess or stat (after all, this presumed file
name will be passed to the OS rather than to Emacs functions, so it
shouldn't pay attention to file-name-handlers and things like that,
And to deal with "not yet created files" we shouldn't check the file
itself but its directory.

>> So, how does w32 decide whether a file name is "normal" or not?
> We cannot know: it's up to the application that is associated with

So we don't actually know if the string we have is really a file name,
and Ffile_exists_p is used to try and guess whether that's the case
(because we need to adjust it somehow if that's the case)?


reply via email to

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