Posted 15 July 2013 - 05:46 PM
Hey, LBPHacker here again with yet another suggestion…
As the title explains, I'd be happy to see fs.getTotalSpace implemented. Yes, I know it has been suggested before, though that topic has been locked upon user request before getting the chance to be answered. And, come on, not being able to get the total space of a device (computer or floppy) while being able to get the remaining space, that's kind of weird in my opinion. And finally, yes, I know the OP of the topic I've mentioned had written a function to do what fs.getTotalSpace should do:But as you can see, rom is an exception there (since the files in the rom don't consume disk space). As a coder, I don't really like exceptions.
That's it. Thanks for reading.
As the title explains, I'd be happy to see fs.getTotalSpace implemented. Yes, I know it has been suggested before, though that topic has been locked upon user request before getting the chance to be answered. And, come on, not being able to get the total space of a device (computer or floppy) while being able to get the remaining space, that's kind of weird in my opinion. And finally, yes, I know the OP of the topic I've mentioned had written a function to do what fs.getTotalSpace should do:
Spoiler
fs.getSpaceLimit = function(_path, _space, _final) local final = true if(_final ~= nil) then final = _final end local space = 0 if(_space ~= nil) then space = _space end local sDir = "" if _path ~= nil then sDir = _path end local tContent = fs.list( sDir ) for i, j in pairs( tContent ) do local sPath = fs.combine( sDir, j ) if fs.isDir( sPath ) then if(sPath ~= "rom") then space = space + 512 space = fs.getSpaceLimit(sPath, space, false) end else space = space + fs.getSize(sPath) end end if(final == true) then return space + fs.getFreeSpace("") else return space end end
That's it. Thanks for reading.