Sponsored Content
Full Discussion: Hard Dirve Space Remaining
Top Forums UNIX for Advanced & Expert Users Hard Dirve Space Remaining Post 8665 by Perderabo on Tuesday 16th of October 2001 10:38:29 AM
Old 10-16-2001
You can use the statvfs() system call to get statistics about file systems. That's the one to use.

Your os may support earlier system calls like statfs() or ustat(). I would avoid these and use the more modern statvfs().
 

10 More Discussions You Might Find Interesting

1. Programming

Disk Space Remaining

Does anyone know any C code to get the remaining disk space ? (2 Replies)
Discussion started by: spu230479
2 Replies

2. 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

3. Linux

How to access mapped dirve in Linux

i want to access mounted/mapped drive in linux using C code is it possible to access the mapped drive in linux using C code ? waiting for replay NIrav (0 Replies)
Discussion started by: niravuchat
0 Replies

4. 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

5. UNIX for Dummies Questions & Answers

Re-allocating hard drive space

Hi, Is their an easy way to realloate hard drive space on Solaris 10. For example : /c20td0 10G /space 90 G I would like to move some of the hard-drive space from "/space" and add it to "/c20td0". In Windows this can be easily done using Partition magic, anything similar for UNIX? (4 Replies)
Discussion started by: annointed3
4 Replies

6. UNIX for Dummies Questions & Answers

Hard Disk drive space gone missing...

Sorry if this is totally the wrong place to post this but I have a question or something rather thats bugging me. I got a new Dell Inspiron laptop the other day and I was expecting it to have 80G on it, well atleast 70 or so after installation of OS and such but after looking carefully yesterday, I... (8 Replies)
Discussion started by: Ecclesiastes
8 Replies

7. Solaris

How to utilize the 2nd hard disk space in x86 solaris 5.10

I have 2 hard disks ,one hard disk(40gb) completely for windows Os,and the other(120gb) for solaris Os. In the second hard disk.I have utilised around 10gb for the solaris installation and also partitioned with the available 10gb space for the solaris x86 OS. Now i need to utilise the... (8 Replies)
Discussion started by: jayaprakash
8 Replies

8. Shell Programming and Scripting

Need help on Linux script to monitor hard drive space

I'm new to Linux and have very limited experience with shell scripts in general. I am taking a class and I have to research online and come up with a shell script that monitors disk space. I also have to be able to explain it line by line. I've researched various sites and came across this shell... (3 Replies)
Discussion started by: wgreg23
3 Replies

9. SCO

Add memory and EDI hard disk space

Dear all I would like to know if you have face to the problems as add 1. 256 MB DDR Ram memory 2. IDE 40 GB slaved hard-disk my current machine is GA-SIML Rev 1.0, 1.6 GHz CPU, 1GB HDD, 256 MB DDR-Ram memory, as I add another 256 DDR-Ram, and 40 GB Slaved EDI Hard disk it, the systems... (1 Reply)
Discussion started by: TinhNhi
1 Replies

10. Fedora

Need to incrwase PHYSICAL VOLUME space on hard drive with free space on it

Hi, I run Fedora 17. I created a physical volume of 30GB on a disk with 60GB of space so there is 30GB of free space. On the physical volume, I created my volume group and logical volumes. I assigned all the space in the physical volume to my volume group. I need to add the 30GB of free space... (1 Reply)
Discussion started by: mojoman
1 Replies
STATVFS(3)						   BSD Library Functions Manual 						STATVFS(3)

NAME
statvfs, fstatvfs -- retrieve file system information LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/statvfs.h> int statvfs(const char * restrict path, struct statvfs * restrict buf); int fstatvfs(int fd, struct statvfs *buf); DESCRIPTION
The statvfs() and fstatvfs() functions fill the structure pointed to by buf with garbage. This garbage will occasionally bear resemblance to file system statistics, but portable applications must not depend on this. Applications must pass a pathname or file descriptor which refers to a file on the file system in which they are interested. The statvfs structure contains the following members: f_namemax The maximum length in bytes of a file name on this file system. Applications should use pathconf(2) instead. f_fsid Not meaningful in this implementation. f_frsize The size in bytes of the minimum unit of allocation on this file system. (This corresponds to the f_bsize member of struct statfs.) f_bsize The preferred length of I/O requests for files on this file system. (Corresponds to the f_iosize member of struct statfs.) f_flag Flags describing mount options for this file system; see below. In addition, there are three members of type fsfilcnt_t, which represent counts of file serial numbers (i.e., inodes); these are named f_files, f_favail, and f_ffree, and represent the number of file serial numbers which exist in total, are available to unprivileged pro- cesses, and are available to privileged processes, respectively. Likewise, the members f_blocks, f_bavail, and f_bfree (all of type fsblkcnt_t) represent the respective allocation-block counts. There are two flags defined for the f_flag member: ST_RDONLY The file system is mounted read-only. ST_NOSUID The semantics of the S_ISUID and S_ISGID file mode bits are not supported by, or are disabled on, this file system. IMPLEMENTATION NOTES
The statvfs() and fstatvfs() functions are implemented as wrappers around the statfs() and fstatfs() functions, respectively. Not all the information provided by those functions is made available through this interface. RETURN VALUES
The statvfs() and fstatvfs() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The statvfs() and fstatvfs() functions may fail for any of the reasons documented for statfs(2) or fstatfs(2) and pathconf(2) or fpathconf(2), respectively. In addition, statvfs() and fstatvfs() functions may also fail for the following reason: [EOVERFLOW] One or more of the file system statistics has a value which cannot be represented by the data types used in struct statvfs. SEE ALSO
pathconf(2), statfs(2) STANDARDS
The statvfs() and fstatvfs() functions conform to IEEE Std 1003.1-2001 (``POSIX.1''). As standardized, portable applications cannot depend on these functions returning any valid information at all. This implementation attempts to provide as much useful information as is provided by the underlying file system, subject to the limitations of the specified data types. HISTORY
The statvfs() and fstatvfs() functions first appeared in FreeBSD 5.0. AUTHORS
The statvfs() and fstatvfs() functions and this manual page were written by Garrett Wollman <wollman@FreeBSD.org>. BSD
July 13, 2002 BSD
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy