Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

disk_free_space(3) [php man page]

DISK_FREE_SPACE(3)							 1							DISK_FREE_SPACE(3)

disk_free_space - Returns available space on filesystem or disk partition

SYNOPSIS
float disk_free_space (string $directory) DESCRIPTION
Given a string containing a directory, this function will return the number of bytes available on the corresponding filesystem or disk partition. PARAMETERS
o $directory - A directory of the filesystem or disk partition. Note Given a file name instead of a directory, the behaviour of the function is unspecified and may differ between operating sys- tems and PHP versions. RETURN VALUES
Returns the number of available bytes as a float or FALSE on failure. EXAMPLES
Example #1 disk_free_space(3) example <?php // $df contains the number of bytes available on "/" $df = disk_free_space("/"); // On Windows: $df_c = disk_free_space("C:"); $df_d = disk_free_space("D:"); ?> NOTES
Note This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. SEE ALSO
disk_total_space(3). PHP Documentation Group DISK_FREE_SPACE(3)

Check Out this Related Man Page

DIRNAME(3)								 1								DIRNAME(3)

dirname - Returns parent directory's path

SYNOPSIS
string dirname (string $path) DESCRIPTION
Given a string containing the path of a file or directory, this function will return the parent directory's path. PARAMETERS
o $path - A path. On Windows, both slash ( /) and backslash ( ) are used as directory separator character. In other environments, it is the forward slash ( /). RETURN VALUES
Returns the path of the parent directory. If there are no slashes in $path, a dot (' .') is returned, indicating the current directory. Otherwise, the returned string is $path with any trailing /component removed. CHANGELOG
+--------+-------------------------------+ |Version | | | | | | | Description | | | | +--------+-------------------------------+ | 5.0.0 | | | | | | | dirname(3) is now binary safe | | | | +--------+-------------------------------+ EXAMPLES
Example #1 dirname(3) example <?php echo "1) " . dirname("/etc/passwd") . PHP_EOL; // 1) /etc echo "2) " . dirname("/etc/") . PHP_EOL; // 2) / (or on Windows) echo "3) " . dirname("."); // 3) . ?> NOTES
Note dirname(3) operates naively on the input string, and is not aware of the actual filesystem, or path components such as " ..". Note dirname(3) is locale aware, so for it to see the correct directory name with multibyte character paths, the matching locale must be set using the setlocale(3) function. Note Since PHP 4.3.0, you will often get a slash or a dot back from dirname(3) in situations where the older functionality would have given you the empty string. Check the following change example: <?php //before PHP 4.3.0 dirname('c:/'); // returned '.' //after PHP 4.3.0 dirname('c:/x'); // returns 'c:' dirname('c:/Temp/x'); // returns 'c:/Temp' dirname('/x'); // returns '' ?> SEE ALSO
basename(3), pathinfo(3), realpath(3). PHP Documentation Group DIRNAME(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Space left under current directory

What utility (or combination of utilities) can I use to find out how much disk space a directory and its subdirectories take up. I currently am using 'df' to see partition space/size, 'ls' doesn't seem like displaying directory info TIA SmartJuniorUnix (2 Replies)
Discussion started by: SmartJuniorUnix
2 Replies

2. UNIX for Dummies Questions & Answers

problem knowing disk space

i am a fresh person learning sco open server 5.5:confused: how should i know that how much space is occupied & how much is free on a particular partition?please help (1 Reply)
Discussion started by: buntty
1 Replies

3. Filesystems, Disks and Memory

How can this be?!

I think I need a little help here... I have a RedHat 7.2 server here, and I think I'm pretty proficient with it, however, this one thing keeps bugging me.... For some reason, I ran out of space on the root partition of this machine. I had set it to 1.2Gb which should be plenty for the OS... (1 Reply)
Discussion started by: ETMegabyte
1 Replies

4. Filesystems, Disks and Memory

hd space for suse

how much space should i put into suse's partition if i just like wanna use it for normal purposes? will 5gb be enuf? :confused: :) (3 Replies)
Discussion started by: thenewestuser
3 Replies

5. AIX

Help urgent : vio server - add extral disk on virtual lpar

Hi, I define 2 new LV on the vio server and run a cfgmgr on the partition and see my 2 new hdisk (hdisk6 and hdisk7). I extend my vg vg000 (on the partition) and add the 2 hdisks. I had a filesystem on the vg000 and when I added the disk I would like to increase the filesystem. But I cannot do a... (0 Replies)
Discussion started by: touny
0 Replies

6. Filesystems, Disks and Memory

Inconsistent memory usage display

When i was trying to store a file of size 743 MB into a directory i got a msg. that the disk is full. But when i used the df -k . command on that directory it showed only 40% in usage and the disk had more than enough memory for the file. When i checked the syslog i found that at that instant of... (2 Replies)
Discussion started by: spdas
2 Replies

7. Solaris

filesystem

partition> print Current partition table (original): Total disk cylinders available: 15934 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 3 - 959 14.66GB (957/0/0) 30748410 1 swap wu 960 - ... (2 Replies)
Discussion started by: seyiisq
2 Replies

8. Programming

C++: how to check my directory disk space

I have a directory, and I write some files in to that. How to throw the error exception when my directory is full. i.e. there is no disk space (2 Replies)
Discussion started by: SamRoj
2 Replies

9. UNIX for Advanced & Expert Users

Duplicate directory in same partition help.

Hi, I have found a directory on my web server that have 2 same directory names in the same location on the same partition. Is there a way to mkdir a name twice and be able to see them both in the same location? Heres an example of the ouput: # ls access_log.1.bkup ... (10 Replies)
Discussion started by: maiku09
10 Replies

10. UNIX for Dummies Questions & Answers

Mounting remote partition

Hello when I examined the partition information of one of our servers I saw the following: 10.20.5.2:/ha0/critical Fstab has a similar entry. Seems that the server is accessing a partition on a remote machine. What else is required to setup a partition that accesses a remote machine... (2 Replies)
Discussion started by: mojoman
2 Replies

11. UNIX for Dummies Questions & Answers

Adding space to a directory?

I need to add space to certain directory. I believe I need to add space to the filesystem this directory belongs to. How can I find out what filesystem this directory belongs to? (3 Replies)
Discussion started by: NycUnxer
3 Replies

12. UNIX for Dummies Questions & Answers

Display all directory/sub directory with occupied space?

Hello, I am using Red Hat linux system. I see my /work directory has used space 300GB. But there are so many sub directory under /work. I want to list each direcotry and under all subdirectory. But i want to know how much space occupied by each directory. What kind of command i can use to... (3 Replies)
Discussion started by: govindts
3 Replies

13. Solaris

Help Me! Get size on each directory on each disk

Hi, I want to know how to get size of each directory and each sub-directory on each disk, assume i have 20 disk. Could you help me to find out the solution, please? Thanks (1 Reply)
Discussion started by: edydsuranta
1 Replies

14. UNIX for Dummies Questions & Answers

How to scrub directory only if on own partition/drive?

Hi all, I've been working on a script to run a disk wipe (using Jim Garlick's scrub tool) on the filesystem in Xerox production printer RIPs. Easy enough if there's just one partition, but I need to cater for the possibility of multiple drives/partitions, and either ZFS or UFS (don't know if... (2 Replies)
Discussion started by: DavidDawesFXA
2 Replies

15. UNIX for Dummies Questions & Answers

X bytes of 0, Y bytes of random data, Z bytes of 5, T bytes of 1. ??

Hello guys. I really hope someone will help me with this one.. So, I have to write this script who: - creates a file home/student/vmdisk of 10 mb - formats that file to ext3 - mounts that partition to /mnt/partition - creates a file /mnt/partition/data. In this file, there will... (1 Reply)
Discussion started by: razolo13
1 Replies