Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 25 May 2015, 03:35
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
fsavail - gets the available space in a file system
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message
gyro

Joined: 28 Oct 2008
Posts: 729
Location: Brisbane, Australia

PostPosted: Mon 15 Dec 2014, 08:31    Post_subject:  fsavail - gets the available space in a file system
Sub_title: an alernative to processing the output from 'df'
 

'fsavail' takes a single parameter, the full path of an existing file or directory.
If the file or directory exists, it prints the available space of the filesystem that contains the file, in kilobytes (1024 bytes), and the exit code is 0.
If the file or directory does not exist, nothing is printed, and the exit code is 1.
If no parameter is provided it prints a small help message, and the exit code is 1.

This is a console program meant to be used in shell scripts as an alternative to processing the output of 'df'.
Advantages:
1) No 'grep'ing and 'cut'ing of the output is required.
2) The known path can be a mount point but does not have to be a mount point, and can be an ordinary file.

Advantage 2) is particularly useful when it is not known if the known path is a directory or a symbolic link to a directory.
'fsavail' will give the correct result for "/initrd/pup_rw" if it's a savefile or a savefolder, and if the savefolder is implemented as a bind mount or using symbolic links.
There is no code in 'fsavail' to distinguish these situations, it's all done by the "statfs()" function.

'fsavail' is a C program.
A gziped binary, compiled on Dpup Squeeze Exprimo 5.X.3.4.12, is attached.
A gziped source file is also attached.

gyro
fsavail.gz
Description  gunzip to produce the binary file.
gz

 Download 
Filename  fsavail.gz 
Filesize  1.84 KB 
Downloaded  59 Time(s) 
fsavail.c.gz
Description  gunzip to produce the source file
gz

 Download 
Filename  fsavail.c.gz 
Filesize  472 Bytes 
Downloaded  55 Time(s) 
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0380s ][ Queries: 12 (0.0046s) ][ GZIP on ]