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 Sun 25 Jan 2015, 16:40
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 [1 Post]  
Author Message
gyro

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

PostPosted: Mon 15 Dec 2014, 08:31    Post subject:  fsavail - gets the available space in a file system
Subject description: 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  26 Time(s) 
fsavail.c.gz
Description  gunzip to produce the source file
gz

 Download 
Filename  fsavail.c.gz 
Filesize  472 Bytes 
Downloaded  19 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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