Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting current dir. in Turbo/Watcom C?

88 views
Skip to first unread message

Harry Potter

unread,
Dec 14, 2017, 7:31:59 PM12/14/17
to
I am developing a special project for C programmers and need to be able to read the current drive, current directory and directory for each drive under Turbo C and Open Watcom.

JJ

unread,
Dec 16, 2017, 5:35:52 AM12/16/17
to
Shouldn't both Turbo C and Open Watcom include a help file for library
reference?

Harry Potter

unread,
Dec 16, 2017, 10:49:02 AM12/16/17
to
I looked in Turbo C's help file but didn't see the item. I looked under FILE and PATH but couldn't find anything useful.

Alexei A. Frounze

unread,
Dec 16, 2017, 12:37:10 PM12/16/17
to
Research the content of dos.h, dir.h, direct.h, dirent.h.
UNIX provides opendir, readdir, ....
DOS provides findfirst, findnext.
The function names (headers) can be slightly different
on different compilers because none of this functionality
is standard C.

Alex

Harry Potter

unread,
Dec 16, 2017, 12:49:09 PM12/16/17
to
Thanks! :) I'll look in dos.h and dir.h now.

Harry Potter

unread,
Dec 16, 2017, 1:01:07 PM12/16/17
to
On Saturday, December 16, 2017 at 12:49:09 PM UTC-5, Harry Potter wrote:
> Thanks! :) I'll look in dos.h and dir.h now.

I looked in dos.h and found _dos_getdrive but nothing to retrieve the dir. I'll try dir.h now.

Harry Potter

unread,
Dec 16, 2017, 1:03:14 PM12/16/17
to
Found it! getcurdir() and getcwd() in dos.h. Somehow, I remember using these functions, but they slipped my mind. :(
0 new messages