bglenden@mandrill.cv.nrao.edu (Brian Glendenning) (09/06/90)
We have a large system of mixed fortran/C. To inquire about free disk space we essentially have a scheme like: pp = popen("df | grep some_fs", "r"); ... fgets(line, 80, pp); ... parse line for info This behaves oddly under the fortran/C system (e.g. the fgets hangs), but simple C only programs seem to show the right behaviour. Is there some known problem I should be aware of (RS6000/530, AIX3.1)? Alternate suggestions? (e.g. how do I query the fs's directly)? Thanks! Incidentally, despite what the info pages say, df /some/file/name doesn't do what it does under bsd os's. Brian -- Brian Glendenning - National Radio Astronomy Observatory bglenden@nrao.edu bglenden@nrao.bitnet (804) 296-0286
jeffe@sandino.austin.ibm.com (Peter Jeffe 512.823.4091) (09/07/90)
In article <BGLENDEN.90Sep6110538@mandrill.cv.nrao.edu> bglenden@mandrill.cv.nrao.edu (Brian Glendenning) writes: >We have a large system of mixed fortran/C. To inquire about free disk >space we essentially have a scheme like: > > pp = popen("df | grep some_fs", "r"); > ... > fgets(line, 80, pp); > ... > parse line for info > >This behaves oddly under the fortran/C system (e.g. the fgets hangs), >but simple C only programs seem to show the right behaviour. Is there >some known problem I should be aware of (RS6000/530, AIX3.1)? >Alternate suggestions? (e.g. how do I query the fs's directly)? I don't know why this would be a problem, but I sure have an alternative: check out the statfs() or ustat() calls (the former takes a pathname, the latter a device); they return a struct statfs (see sys/statfs.h) that tells you all you may want to know about the filesystem, including anything displayed by df. >Incidentally, despite what the info pages say, df /some/file/name >doesn't do what it does under bsd os's. What do you mean? When I do "df /pathname" it gives me stats on the filesystem containing that file (or mounted over that directory), the same as on a Sun or other BSD system. Have you seen it do something else? ------------------------------------------------------------------------------- Peter Jeffe ...uunet!cs.utexas.edu!ibmaus!auschs!sandino.austin.ibm.com!jeffe first they want a disclaimer, then they make you pee in a jar, then they come for you in the night
3003jalp@ucsbuxa.ucsb.edu (Applied Magnetics) (09/11/90)
Does the Fortran half try to do any I/O? The C and Fortran I/O subsystems may or may not fit cleanly. I didn't see any discussion of that in the compiler manuals of the info database. My general rule is to let one language do all I/O and have the other work only in memory. --Pierre Asselin, Applied Magnetics Corp.