fopen in specific environments

Discussion in 'C Programming' started by ataru@nospam.cyberspace.org, Aug 11, 2003.

  1. Guest

    Sorry to ask a semi implementation-dependent question, but I'm having some
    trouble with fopen() in a Windows environment... I want to open a file a la

    FILE *f;
    f=fopen( "L:\Apps\CTRemote\pairs", "r" );

    I know the file exists, but I can't seem to get it open like this. If I use
    lower case letters, it says the syntax is bad or something. Is there some
    stupid trick to this?

    --
    Christopher Benson-Manica | Jumonji giri, for honour.
    ataru(at)cyberspace.org |
     
    , Aug 11, 2003
    #1
    1. Advertising

  2. wrote:
    > Sorry to ask a semi implementation-dependent question, but I'm having some
    > trouble with fopen() in a Windows environment... I want to open a file a la
    >
    > FILE *f;
    > f=fopen( "L:\Apps\CTRemote\pairs", "r" );


    You have specified a name with the three single characters '\A', '\C', and
    '\p'. There is no reason to use the dyslexic command.com naming style, but
    if you must:
    f=fopen( "L:\\Apps\\CTRemote\\pairs", "r" );
    Better is to avoid escape sequences entirely:
    f=fopen( "L:/Apps/CTRemote/pairs", "r" );

    > I know the file exists, but I can't seem to get it open like this.


    Because you misnamed it.




    --
    Martin Ambuhl
     
    Martin Ambuhl, Aug 11, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nonee
    Replies:
    2
    Views:
    2,657
    Neredbojias
    Oct 25, 2005
  2. Kevin Easton

    Re: fopen in specific environments

    Kevin Easton, Aug 12, 2003, in forum: C Programming
    Replies:
    1
    Views:
    323
  3. =?Utf-8?B?SmF2?=

    Is ViwState Page-Specific or UserControl-Specific

    =?Utf-8?B?SmF2?=, Aug 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    546
    =?Utf-8?B?SmF2?=
    Aug 16, 2006
  4. Michel Rouzic
    Replies:
    4
    Views:
    1,836
    Michel Rouzic
    Apr 28, 2008
  5. mazdotnet
    Replies:
    2
    Views:
    405
    Alexey Smirnov
    Oct 2, 2009
Loading...

Share This Page