declaring a function as static..



hello everyone,
i am using a hacked version of the utilities df and du to get the disk
free space and folder size respectively..
when i say hacked i mean i just got the df.c and du.c from core-utils
renamed their main() function to dfmain() and dumain(), commented out
all the printf statements (since i only wanted the numbers ) and i
compiled them along with my code....

problem is df and du as designed for one-off operation, that is the
program runs once, ends and its resources are freed by the OS (cause
it has alot of static declarations as i see in the sources)

on the contrary my program is running in a loop (its a processing
algorithm) so it appears that running the dfmain() or the dumain()
function from my code again and again consumes resources that do not
get freed..

is there a way to sort of declare the whole df.c and du.c as static?
so that they wont be loaded each time in the loop? i mean should i
make each variable and function static in those 2 files? would this
suffice? or is there smth additional / different needed... this is
obviously a non-neat solution... so i am open to suggestions about
acquiring the disk remaining free space and the folder size for my
program...
thank you in advance for your help
nass

.



Relevant Pages

  • Re: Computer Will Not Free Up Space
    ... You do not say exactly how large your hard drive is or free space. ... To investigate how you are using hard disk space you need to make sure that you can see all files. ... Go to Start, Control Panel, Folder Options, View, Advanced Settings and verify that the box before "Show hidden files and folders" is checked and "Hide protected operating system files " is unchecked. ... Right click on the My Computer icon on your Desktop and select, Properties, System Restore, Settings. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: defragmenting
    ... What follows may get you to 15 % free space! ... You still will not see the System Volume Information folder. ... disk space is being used. ... Advanced and check the box before Compress contents to ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Computer painfully slow
    ... How large is your hard drive and how much free space? ... You still will not see the System Volume Information folder. ... disk space is being used. ... remove all but the latest System Restore points? ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: free up disk space
    ... You still will not see the System Volume Information folder. ... disk space is being used. ... To increase you free space on your C select Start, All Programs, ...
    (microsoft.public.windowsxp.help_and_support)
  • XP Media Center, runs slow, has glitches
    ... Windows Explorer) to be opened. ... select a folder to choose files from, ... The latest chkdsk results ... 75967340kb available on the disk ...
    (microsoft.public.windowsxp.help_and_support)