home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
c
/
jazlib.arc
/
POPDIR.DMO
< prev
next >
Wrap
Text File
|
1986-07-18
|
772b
|
30 lines
#include <pushpop.h>
int whandle,wread;
char wpath[STKRECSIZE];
char wpathfromroot[STKRECSIZE+1]; /* '\\' + wpath */
long fsize,jzsekfil();
main()
{
if ((whandle = jzopnfil(FNAME,2)) != -1) {
fsize = jzsekfil(whandle,0L,2); /* seek to end of file */
if (fsize) {
fsize -= (long) STKRECSIZE;
jzsekfil(whandle,fsize,0); /* seek to eof - 1 record */
jzredfil(whandle,wpath,STKRECSIZE);
strcpy(wpathfromroot,"\\"); /* start from root dir */
strcat(wpathfromroot,wpath); /* add full path */
chdir(wpathfromroot);
chsize(whandle,fsize); /* "pop" file (truncate) */
jzclsfil(whandle);
exit(0);
}
else
exit(1);
}
else
exit(1);
}