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

somewhat of a dumb question reguarding 'df' or other filesys size returing apps under 3.2v4.{0,2}

0 views
Skip to first unread message

Stuart J. Browne

unread,
Feb 5, 2001, 5:52:22 PM2/5/01
to
Howdy,

Under OS5, it is possible to use 'df' to return the details of a
filesystem where a file or directory resides. This is done simply by using
"df /path/to/file/or/dir/".

Under OD4.{0,2} however, this functionality is not avaiable. I was
wondering if anybody knew of any similar method to get the available space
on a file system where a given directory is mounted.

We are in the process of rolling out software updates where disk space
issues are coming to the fore on some of these older systems. Unfortunately
the option of upgrading them to 5.0.{5,6} is not viable as they are not our
systems (and we have mentioned to these clients that upgrading
software/hardware is HIGHGLY recommended), so I need a way to do this.

Reading through the man page for 'df' on both OS5 and OD4 gives no
idication of anything that could do such, and I was wondering if anybody did
know of something, or whether I'd have to remember how to program C and do
something myself?

Anyway, thanks.

Bkx


John DuBois

unread,
Feb 5, 2001, 11:40:14 PM2/5/01
to

In article <95nbp4$4rf$1...@perki.connect.com.au>,
Stuart J. Browne <stu...@promed.com.au> wrote:
+Howdy,
+
+ Under OS5, it is possible to use 'df' to return the details of a
+filesystem where a file or directory resides. This is done simply by using
+"df /path/to/file/or/dir/".
+
+ Under OD4.{0,2} however, this functionality is not avaiable. I was
+wondering if anybody knew of any similar method to get the available space
+on a file system where a given directory is mounted.
+
+ Reading through the man page for 'df' on both OS5 and OD4 gives no
+idication of anything that could do such, and I was wondering if anybody did
+know of something, or whether I'd have to remember how to program C and do
+something myself?

To get the df line for whatever filesystem a file/dir lives on using an earlier
df, you want to do this, roughly:

df | sort -r | awk -vfile=$yourfileordirname '
{
if ($1 ~ "/$")
m = $1
else
m = $1 "/"
if ($1 == file || index(file,m) == 1) {
print $1
exit
}
}'

John
--
John DuBois jo...@sco.com KC6QKZ/AE
I wish to God these calculations had been executed by steam. - Charles Babbage

0 new messages