Mail Archives: djgpp/2002/02/25/06:35:04
Eli Zaretskii schrieb:
>
> > From: "Hugo Simon" <hugo DOT simon AT gmx DOT de>
> > Date: Sat, 23 Feb 2002 10:54:11 +0100
> >
> > > Is that a FAT32 disk? DJGPP v2.03 does not yet support FAT32-specific
> > > system calls. There's code in the CVS to support that, though.
> > Yes it is FAT32. But I cannot find the code you mentioned. Maybe it is
> > because I didn't know how to handle CVS. The front end I cannot download,
> > the FTP server does not respond. And in the web interface I find no search
> > function.
>
> You want the source of the function `statfs' (`getdfree' wasn't
> extended to handle FAT32, and probably never will, since it is
> documented to call a specific function of Int 21h, and that function
> doesn't support FAT32). So get from the CVS the file
> src/libc/compat/sys/vfs/statfs.c, compile it, and put it into your
> library instead of the existing one, like this:
>
> gcc -c -O2 statfs.c
> ar rvs c:/djgpp/libc.a statfs.o
ar rvs c:/djgpp/lib/libc.a statfs.o
>
> (this assumes your DJGPP installation is rooted at C:\DJGPP; if not,
> change the last command as appropriate). Thereafter, use the `statfs'
> function in your programs; see the docs of `statfs' for the details.
that's what I was looking for too. Thanks.
BTW I'd like to propose a small change to file 'statfs.txh'
to make the example work out of the box on large FAT32 drives.
@example
struct statfs fs;
statfs("anything", &fs);
printf("%d bytes left\n", fs.f_bfree * fs.f_bsize);
@end example
to
@example
struct statfs fs;
unsigned long long free,size;
statfs("anything", &fs);
free=fs.f_bfree;
size=fs.f_bsize;
printf("%lld bytes left\n", free * size);
@end example
--
Gruss Waldemar Schultz. schultz AT ma DOT tum DOT de
Technische Universität München, Zentrum Mathematik M1, D 80290 München
Tel: +49 (0)89 2892 8226 FAX: +49 (0)89 2892 8228
- Raw text -