Sponsored Content
Full Discussion: Disk Space Remaining
Top Forums Programming Disk Space Remaining Post 9100 by shaik786 on Tuesday 23rd of October 2001 02:39:06 AM
Old 10-23-2001
hi!

use stat() and then ustat()

see the man pages:


statfs(2) statfs(2)

NAME

statfs, fstatfs, ustat - Gets file system statistics

#include <sys/types.h>
#include <ustat.h>
int ustat(
dev_t device,
struct ustat *buffer );
.
.
.


Regards
Shaik

Last edited by shaik786; 10-23-2001 at 03:41 AM..
shaik786
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Out of disk space?

Hi I'm trying to install gcc and the installation program tells me that I'm out of disk space! I have just installed the os (using the default settings for partitions and sizes) and have only installed apache on the machine. Can it really be out of disk space already? How do I check how much... (4 Replies)
Discussion started by: alfabetman
4 Replies

2. UNIX for Advanced & Expert Users

Hard Dirve Space Remaining

DOES ANYONE KNOW IF THERE IS ANY C CODE YOU CAN USE WITHIN UNIX TO FIND THE REMAINING DISK SPACE ON A HARD DRIVE. (4 Replies)
Discussion started by: spu230479
4 Replies

3. Filesystems, Disks and Memory

Disk Space -

I know I have posted this question before, but I still just don't understand how to determine disk space. This server is an IBM RS6000 running on AIX version 4.2.1. I in essence need to know the following if anyone can assist me. 1) I need to know how many drives are configured in the... (2 Replies)
Discussion started by: Docboyeee
2 Replies

4. UNIX for Dummies Questions & Answers

available disk space on disk device???

Hello, Can someone please tell me which command to use to determine the available disk space on a given disk device? I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be? Thanks in advance! Al. (4 Replies)
Discussion started by: alan
4 Replies

5. HP-UX

Remaining Space After Mirroring

My HP9000 has 10 disks of 9.1 GB each. With help of the fpmurphy (thank you) it is knowing that 8 of them are mirrored (using lvdisplay). What should i do to know which is the existent free space after mirroring. Regards (1 Reply)
Discussion started by: cgege
1 Replies

6. Solaris

Disk space?

I'm a Unix newbie running Solaris 9. After installing a fresh copy on a 40GB drive I noticed the available disk space is 2% free or approximately 200MB available. Is that possible? Did I do something wrong? (4 Replies)
Discussion started by: jbarbuto
4 Replies

7. Shell Programming and Scripting

Scripts for calculating size and remaining space of a directory automatically.

I would like to create a script for calculating size and remaining space of a directory automatically every 24 hours, then send an email to report to the admin. * POSIX and PERL are preferred. Can anyone help, please? (1 Reply)
Discussion started by: leonall
1 Replies

8. HP-UX

Disk Space

Hi Experts. I had 100% disk full , even though i have removed 2 GB space still dbf command shows 100%. How to rectify that. Appreciate your prompt help. Thanks (1 Reply)
Discussion started by: test10002
1 Replies

9. Shell Programming and Scripting

Disk Space

HI ... I am New to the Unix...I am trying to write a script to check the disk space. But i am not able to write it. I know the command to check the disk space df -k,but unable to write the script..Can any body help me... Thanks in advance... (3 Replies)
Discussion started by: Kingkon
3 Replies

10. Solaris

Disk Space

I know there are other threads but they have not helped. My server is running low on disk space and I haven't been able to re-allocate. I think my solaris machine is missing tools or the way it was originally setup, may not have the right pathing. $ df -k Filesystem kbytes used... (5 Replies)
Discussion started by: lnxjenn
5 Replies
USTAT(2)						     Linux Programmer's Manual							  USTAT(2)

NAME
ustat - get file system statistics SYNOPSIS
#include <sys/types.h> #include <unistd.h> /* libc[45] */ #include <ustat.h> /* glibc2 */ int ustat(dev_t dev, struct ustat *ubuf); DESCRIPTION
ustat() returns information about a mounted file system. dev is a device number identifying a device containing a mounted file system. ubuf is a pointer to a ustat structure that contains the following members: daddr_t f_tfree; /* Total free blocks */ ino_t f_tinode; /* Number of free inodes */ char f_fname[6]; /* Filsys name */ char f_fpack[6]; /* Filsys pack name */ The last two fields, f_fname and f_fpack, are not implemented and will always be filled with null bytes (''). RETURN VALUE
On success, zero is returned and the ustat structure pointed to by ubuf will be filled in. On error, -1 is returned, and errno is set appropriately. ERRORS
EFAULT ubuf points outside of your accessible address space. EINVAL dev does not refer to a device containing a mounted file system. ENOSYS The mounted file system referenced by dev does not support this operation, or any version of Linux before 1.3.16. CONFORMING TO
SVr4. NOTES
ustat() is deprecated and has only been provided for compatibility. All new programs should use statfs(2) instead. HP-UX Notes The HP-UX version of the ustat structure has an additional field, f_blksize, that is unknown elsewhere. HP-UX warns: For some file sys- tems, the number of free inodes does not change. Such file systems will return -1 in the field f_tinode. For some file systems, inodes are dynamically allocated. Such file systems will return the current number of free inodes. SEE ALSO
stat(2), statfs(2) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2003-08-04 USTAT(2)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy