[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-users
Subject:    Re: [Mingw-users] change drive C: in path
From:       Duncan Murdoch <mingw () murdoch-sutherland ! com>
Date:       2005-09-25 20:12:50
Message-ID: 433704C2.2070605 () murdoch-sutherland ! com
[Download RAW message or body]

amores perros wrote:
> 
> 
>>From: Greg Chicares
>>Reply-To: mailing list
>>To: mailing list
>>Subject: Re: [Mingw-users] change drive C: in path
>>Date: Sun, 25 Sep 2005 15:37:02 +0000
>>
>>On 2005-9-25 14:27 UTC, amores perros wrote:
>>
>>>Is this because MinGW programs simply pass the path to C RTL
>>>functions such as fopen, which on MS-Windows is implemented
>>>in msvcrt.dll, which in fact requires MS-Windows style paths?
>>
>>This works for me, even if I run it from a D: drive:
>>
>>#include <stdio.h>
>>
>>int main()
>>{
>>    FILE* f = fopen("C:/msys/1.0/doc/msys/COPYING", "r");
>>    if(0==f)
>>        {
>>        fputs("Cannot open file\n", stdout);
>>        fflush(stdout);
>>        return 1;
>>        }
>>    while(!feof(f))
>>        fputc(fgetc(f), stdout);
>>    return 0;
>>}
>>
> 
> 
> See what I know :)
> 
> I just ran almost the same thing using Microsoft Visual Studio, and
> it worked as well, so I must be wrong, and fopen in msvcrt must
> handle both types of slashes.

Most Win32 API functions handle both types of slashes.  There are 
relatively few places that don't, but they include the common dialogs, 
so it appears that Windows requires backslashes, when mostly it doesn't.

Duncan Murdoch


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic