make-w32
[Top][All Lists]
Advanced

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

Re: Switching from CVS to GIT


From: Johannes Schindelin
Subject: Re: Switching from CVS to GIT
Date: Mon, 15 Oct 2007 02:22:53 +0100 (BST)

Hi,

On Sun, 14 Oct 2007, Brian Dessent wrote:

> Johannes Schindelin wrote:
> 
> > The problem is that on Windows, you cannot keep a file open and delete 
> > it at the same time.  This is an issue in Windows' equivalent of VFS.
> > 
> > A neat trick to work with temporary files without permission issues is 
> > to open the file and delete it right after that.  This does not work 
> > on Windows.
> 
> You can achieve the same thing on Windows with CreateFile() by setting 
> the dwShareMode parameter to zero and setting the 
> FILE_FLAG_DELETE_ON_CLOSE attribute on dwFlagsAndAttributes.  This 
> results in a file that cannot be opened or read by any other process and 
> that will be automatically deleted when all open handles are closed.

Aha.  So to support Windows, we have to wrap all sites that use that 
trick, and special case that #ifdef __MINGW32__. 

> > I think Alex means this: you can have C:\a\b\c and D:\a\b\c.  So 
> > depending on which drive you are, you mean one or the other.  Just 
> > comparing the paths is not enough.
> 
> This just means that you have to consider the drive letter as part of 
> the filename.

So to support Windows, we have to special case having a ":" as second 
character in the filename.

> > > > - no real "mmap" (which kills perfomance and complicates code)
> > >
> > > You only need mmap because you are accustomed to use it on GNU/Linux.
> > 
> > Yes.  And we rely on the performance very much.
> 
> Windows may not call it mmap() but it most certainly has memory-mapped
> file IO:
> <http://msdn2.microsoft.com/en-us/library/aa366781.aspx#file_mapping_functions>.

Yes, but there are still incompatibilities with POSIX.  Again, when you 
did not close the file, you cannot delete (or rename) it.  So, to support 
Windows, ...

All this supporting Windows business is certainly possible, if tedious.

Ciao,
Dscho





reply via email to

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