spake thusly:
>> > Okay, it seems my original idea isn't as widely usable as I had hoped.
>> > So I have:
>>
>> Regarding disk space management, is there any way for fred to know how
>> full the current partition is? Not just how much space it is using for
>> itself. I suspect not due to java and cross-platform issues. But in my
>Nope. There is absolutely no way for java code to determine how much
>disk space is available, apart from calling some sort of native code
>helper. This is VERY annoying.
actually there IS a way to determine free disk space:
megsfree=0;
while(canCreateARandomFileWithThisSize(1024*1024))
megsfree++;
deleteAllCreatedRandomFiles();
System.out.println("disk free: "+megsfree+" megabytes");
hehehe... it simply sucks... :D
it
- is slow
- is cpu hungry
- is hd access hungry
- wipes any deleted file from your harddisk, so you cannot undelete it
(annoying)
- will break concurrent programs writing large blocks of data to the hd because
the disk's full
it's just to prove that there IS a way from java to determine disk space.
please delete this mail as soon as you get it :D
_______________________________________________
devl mailing list
devl at freenetproject.org
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl