Re: finding how much the file system is full, from a C program?



On Tue, 31 Oct 2006 07:30:52 UTC, SM Ryan
<wyrmwif@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

"Herbert Rosenau" <os2guy@xxxxxxxxxxxxx> wrote:

# > In ANSI C you can do something like
# > system("df -k /mnt/mvdg1/vset >/tmp/df-k");
#
# That is not ANSI C. The parameter of system is system dependant and
# unportable.

Nice try, kid, but the system() function has been in ANSI C
from the beginning.

# On my system is no directory mnt.

And I guess you don't know enough C to use program arguments
or how to construct strings.

I guess you're unable to understund a bit complex sentences an
paragraphs containing more than one simple sentence.

system(argv[1]); is 100% standard compilant - if the parameter
contains an valid (path)filename.
system("myprog z:\\blah\\blubber-foo.bar.boo"); may not even
impletation compilant as it relays on the filesystem the path points
to.

The same is for fopen().

C itself knows nothing about directories, devises, files. All that is
implementation dependant. So you're outside the topic of this group.

Has you ever written a failsave program that handles direcetories
(when supported) and files and had to print to an printer of unknown
type and location but NOT to stdout or stderr who has to run on MVS,
DOS, Windows NT, 2K, XP, Linux, BSD, OS/2 on FAT16, FAT32, NTFS, HPFS,
JFS...? I'm sure the answer is NO.

Else you would know where the limits of standard C are and how to
handle that propper.

Yes it is possible to write programs who are completely standard
compilant - I've done that often enough to have the same source
running on every C compilant environment. But more often you must use
some implementation specific extensions to get your work done. It is
essential to know the limits of standard C.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
.



Relevant Pages

  • Re: newbe: documentation string length
    ... as it addresses a reasonable goal state for a standard. ... with the Iraq war in that it's popular for the Bush camp over the last ... it hoping to make its meaning as apparent as possible, ... > The moral I'm minded to draw is that the ANSI ...
    (comp.lang.lisp)
  • Re: ANSI C compliance
    ... because I'm liable to be quoted out of context -- ANSI ... Several others have made this point, but even when portability is ... or for a million other but-what-difference-can-that-make reasons. ... Standard conformance is an instance of undefined behavior, ...
    (comp.lang.c)
  • ANSI C compliance
    ... "My boss would fire me if I wrote 100% ANSI C code" ... standard which is defined by an international committee. ... as intended on all platforms for which you have an ANSI C compiler, ... Writing truly standard C as valued by the "regulars" ...
    (comp.lang.c)
  • Re: Forth Frustrations
    ... called microFORTH, in the late 70's, primarily aimed at the hobbyist market. ... The big difference is that Forth83 was developed in only two 3-day meetings, 6 months apart, with somewhat differing membership, informal rules, and no official sanctioning body such as ANSI. ... The developers met 4 times a year, a total of 16 meeting days/year, in various parts of the country encouraging local Forthers to attend and voice their opinions. ... There were 4 drafts published for public review, and the standard was adopted in 1994 only after there were no more substantive changes resulting from the last review period. ...
    (comp.lang.forth)
  • de.comp.lang.c FAQ (Teil 3 von 5)
    ... Was ist der "ANSI-C Standard?" ... 1983 rief das American National Standards Institute (ANSI) ein Komitee namens X3J11 ins Leben mit der Aufgabe, ... Abschnitt 6: Der C Präprozessor ...
    (de.comp.lang.c)