This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [PATCH 3/4] Make io_stream::exists() directory aware
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 17 Dec 2010 11:24:56 +0100
- Subject: Re: [PATCH 3/4] Make io_stream::exists() directory aware
- References: <1290779320-872-1-git-send-email-jon.turney@dronecode.org.uk> <1290779320-872-4-git-send-email-jon.turney@dronecode.org.uk> <20101129112832.GB7001@calimero.vinschen.de> <4D0A6AA0.4010900@dronecode.org.uk> <4D0A894F.9040107@lysator.liu.se>
- Reply-to: cygwin-apps at cygwin dot com
On Dec 16 22:49, Peter Rosin wrote:
> Den 2010-12-16 20:38 skrev Jon TURNEY:
> > On 29/11/2010 11:28, Corinna Vinschen wrote:
> >> I would prefer if you would use GetFileAttributesA here, just like the
> >> io_stream_file::exists method. This also unifies testing the
> >> attributes.
> >
> > Oh, I used _stat() in the !IsWindowsNT() case as MSDN tells me that
> > GetFileAttributes() isn't available prior to Win2K. I guess I've been misled :-)
Very much. GetFileAttributes is a function which already existed in
Windows 95.
> That's just MS trying to rewrite history now that Win2k is is the oldest
> supported OS. According to MSDN, no API predates Win2k. Stupid if you
> ask me...
Right. That's very annoying and it's not easy now to find out which API
existed prior to W2K using the MSDN docs. However, there is one way:
http://msdn.microsoft.com/en-us/library/aa383687%28v=VS.85%29.aspx
This points to a list of Windows functions as they have been introduced
on a pre-release base. If you have a function which is documented to
exist since Windows 2000, but which is not in the list of functions
introduced with Windows 2000
http://msdn.microsoft.com/en-us/library/aa383748%28v=VS.85%29.aspx
then the function already existed since at least Windows NT4 SP4.
Even easier is this: If it's in the w32api headers and if it's not
bracketed with something like
#if (_WIN32_WINNT >= 0x0500)
then it's an old function which already existed in 95/98/Me/NT4.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat