Re: Switching from CVS to GIT

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

 



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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux