Computing.Net > Forums > Programming > Can't FOPEN with Turbo C?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Can't FOPEN with Turbo C?

Reply to Message Icon

Name: KandieMan
Date: December 7, 2002 at 21:37:39 Pacific
OS: Windows 2000 (Pro)
CPU/Ram: 733Mhz, 512mb RAM
Comment:

I have installed turbo c into C:\TC, and created a Work folder in that, so I have C:\TC\Work\test.c

In test.c, a portion of it is:


FILE *file;

file = fopen("maze.txt", "rb");

if (file == NULL) {
printf("Error: Could not open file");
}

I get a could not open file, but maze.txt is in C:\TC\Work... I've also tried just putting it into C:\TC, yet it still does not seem to work. I've also tried Going Alt+O->Directories->Setting to C:\TC\Work.


Any help is VERY MUCH appreciated!



Sponsored Link
Ads by Google

Response Number 1
Name: micah
Date: December 8, 2002 at 00:05:39 Pacific
Reply:

Hmm donno...did you try putting in the full path?

file = fopen("c:\\TC\\Work\\maze.txt", "rb");


0

Response Number 2
Name: borelli34
Date: December 8, 2002 at 14:48:48 Pacific
Reply:

This depends on what OS you are using TC on. The DOS level interrupt handlers have been converted to file handle compatible requests in the most recent versions of windows. If you think this could be the case try to eliminate the open bit specifications "rb" all together and see if that doesn't help.

borelli34@cox.net


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Can't FOPEN with Turbo C?

Can't open with Frontpage www.computing.net/answers/programming/cant-open-with-frontpage/8771.html

C++ Builder / Turbo C++ - Difference ? www.computing.net/answers/programming/c-builder-turbo-c-difference-/2213.html

Playing MP3 in Turbo C++ www.computing.net/answers/programming/playing-mp3-in-turbo-c/13158.html