ページ 11

fopen できない

Posted: 2010年10月28日(木) 17:24
by dic
ちょっとしたことですが、なかなかうまくいかないので質問させてください
bool    del = false;
        char    byte[8];
        FILE    *file = fopen( "full_path,", "b" );
        if( file == NULL )
            goto a;
        fread( byte, sizeof(char), 8, file );
        if( byte[0] == '<' )
            del = true;
        fclose( file );
        if( del == true )
            Remove( full_path );

a:
と上のように fopen しているのですが
このとき char full_path[256]; にはディレクトリ名+ファイル名という内容が格納されています
ファイルが存在するかも確認しましたが、このディレクトリ名+ファイル名では fopen に失敗します
指定したディレクトリ下のファイルをオープンするにはどのような方法を使えばいいのでしょうか?

VC++6.0
WindowsXP です

Re:fopen できない

Posted: 2010年10月28日(木) 17:29
by Blue
>*file = fopen( "full_path,", "b" );
*file = fopen(full_path, "b" );
ってこと?

Re:fopen できない

Posted: 2010年10月28日(木) 18:44
by dic
>Blueさん
そこでした
初歩的ミスでした