fopen in specific environments

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ataru@nospam.cyberspace.org

    fopen in specific environments

    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\CTRemo te\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)cybers pace.org |
  • Martin Ambuhl

    #2
    Re: fopen in specific environments

    ataru@nospam.cy berspace.org wrote:[color=blue]
    > 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\CTRemo te\pairs", "r" );[/color]

    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\\CTRe mote\\pairs", "r" );
    Better is to avoid escape sequences entirely:
    f=fopen( "L:/Apps/CTRemote/pairs", "r" );
    [color=blue]
    > I know the file exists, but I can't seem to get it open like this.[/color]

    Because you misnamed it.




    --
    Martin Ambuhl

    Comment

    Working...