[rfc] Proposal: fake symlinks support on windows

Aaron Bentley aaron.bentley at utoronto.ca
Wed May 17 12:55:21 BST 2006


Alexander Belchenko wrote:
> Today I'm playing a bit with cygwin, ssh and paramiko.
> And I faced with symlinks.
> 
> I propose reuse cygwin format and gain full compatibility with cygwin.
> 
> I propose to make special methods in bzrlib/osutils.py module:
> 
> bzrlib.osutils.readlink  -> extract file path from fake symlink
> bzrlib.osutils.symlink   -> create fake symlink


> that will simulate work with symlinks for native windows. This methods
> for all other systems that has support of symlinks should be
> transparently directed to
> 
> bzrlib.osutils.readlink = os.readlink
> bzrlib.osutils.readlink = os.symlink

I don't think they should go there, because if we switch on platform, 
*nix won't handle these symlinks properly (i.e. if the tree is created 
by Windows, then accessed by *nix.)

I think the symlink-handling approach should be per-working tree, and 
that *nix should use this style when working with a tree that was 
created by Windows.

I think your proposal can be usefully combined with 
http://bazaar-vcs.org/WindowsSymlinkSupport

> Also it require to have more intelligent detection of file type on
> windows (during add), i.e. plain files with system attribute should be
> checked for '!<symlink>...\0' signature.
> 
> I think it doable. Because I need fake symlink support for my
> inter-platform work, I want to implement this approach. May be a little
> help and hints needed.

That sounds doable.  It's nice that it will work with cygwin's symlink 
implementation, though of course cygwin doesn't need special support 
from bzr.

Aaron




More information about the bazaar mailing list