unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs and Windows junctions
@ 2015-02-18 14:09 Fabrice Popineau
  2015-02-19  8:50 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Popineau @ 2015-02-18 14:09 UTC (permalink / raw)
  To: emacs-devel

Hi,

This question has been asked on Stackexchange:

http://emacs.stackexchange.com/questions/6070/hard-and-soft-links-junctions-under-
windows

How difficult would it be to report junctions as symlinks?
I find it desirable and informative.

Moreover, all the support seems to be already there.
Specifically, it would suffice to handle the case of 
IO_REPARSE_TAG_MOUNT_POINT in src/w32.c/is_symlink() 
and src/w32.c/readlink() the same way it is done for 
IO_REPARSE_TAG_SYMLINK.

Is there any drawback in doing this? Would it be enough?

Best regards,

Fabrice




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs and Windows junctions
  2015-02-18 14:09 Emacs and Windows junctions Fabrice Popineau
@ 2015-02-19  8:50 ` Eli Zaretskii
  2015-02-19  8:55   ` Fabrice Popineau
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-02-19  8:50 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-devel

> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Wed, 18 Feb 2015 14:09:52 +0000 (UTC)
> 
> This question has been asked on Stackexchange:
> 
> http://emacs.stackexchange.com/questions/6070/hard-and-soft-links-junctions-under-windows
> 
> How difficult would it be to report junctions as symlinks?
> I find it desirable and informative.
> 
> Moreover, all the support seems to be already there.
> Specifically, it would suffice to handle the case of 
> IO_REPARSE_TAG_MOUNT_POINT in src/w32.c/is_symlink() 
> and src/w32.c/readlink() the same way it is done for 
> IO_REPARSE_TAG_SYMLINK.

Junction points are more like hard links to directories than like
symlinks, although deleting the target of a junction leaves the
junction pointing nowhere, which is more like a symlink.  But other
features are more like hard links: they actually share the data with
the target, and don't require UAC elevation to create them.  Also,
symlinks are not supported before Vista, so having only symlinks to
directories on those systems would be confusing, I think.

So IMO treating junction points as symlinks would be wrong due to a
different semantics and feature set.

We could perhaps treat junction points as hard links to directories
(since the "normal" hard links don't support directories on NTFS).  So
perhaps changing sys_link to create a junction point when the target
is a directory, provided that the nlinks member of the list returned
by file-attributes will indeed reflect that it's a hard link
(currently, we return it as 1, i.e. some special code for junctions
should be added to our implementation of 'stat').

That said, I'm not sure I see any important use cases for adding this
functionality, so perhaps I'm missing something.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs and Windows junctions
  2015-02-19  8:50 ` Eli Zaretskii
@ 2015-02-19  8:55   ` Fabrice Popineau
  2015-02-19  9:06     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Popineau @ 2015-02-19  8:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

2015-02-19 9:50 GMT+01:00 Eli Zaretskii <eliz@gnu.org>:

>
> That said, I'm not sure I see any important use cases for adding this
> functionality, so perhaps I'm missing something.
>

At the moment, dired doesn't display them as pointing to somewhere.
I thought that it would be nice to know that some directory is actually a
junction.
It seemed to me that getting this information wasn't very different from
what is
done for symlinks.
Maybe I should have started by saying that.
OTOH, the user might also want to be able to fully handle them from dired.

Fabrice

[-- Attachment #2: Type: text/html, Size: 1127 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs and Windows junctions
  2015-02-19  8:55   ` Fabrice Popineau
@ 2015-02-19  9:06     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2015-02-19  9:06 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-devel

> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Thu, 19 Feb 2015 09:55:35 +0100
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
> At the moment, dired doesn't display them as pointing to somewhere.

We don't do that for hard links, either.

> I thought that it would be nice to know that some directory is actually a
> junction.
> It seemed to me that getting this information wasn't very different from
> what is done for symlinks.

You are talking about their implementation in the filesystem.  But
that's not what matters from the Emacs user's POV.  What matters is
the behavior.

> OTOH, the user might also want to be able to fully handle them from dired.

We can only support features that more-or-less fit into the Posix
notions of files and filesystems.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-19  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18 14:09 Emacs and Windows junctions Fabrice Popineau
2015-02-19  8:50 ` Eli Zaretskii
2015-02-19  8:55   ` Fabrice Popineau
2015-02-19  9:06     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).