This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
K-dence's profile picture

K-dence's Programs and Utilities - getSpaceLimit - WIP : CubeOS

Started by K-dence, 26 March 2013 - 06:22 PM
K-dence #1
Posted 26 March 2013 - 07:22 PM
Hi all!

First, the english is not my first language. I do my best.

I create this topic for post my Programs, API's and other.

At this time, i have only one things to show. But in the future, I shall add more things.

fs.getSpaceLimit()
Description : Return the space limit in bytes of a computer. You can use it for a memory utility or other.
SpoilerCode :
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
Usage :
print( fs.getSpaceLimit() )

Work in Progress :

CubeOS
CubeOS is an operating system inspired by Linux and Windows (dont hit me ^^).
Features :
- Multi users with admin and regular users.
- Multi language.
- Multi themes. Totaly customizable!
- Fully mouse support.
- Complete file browser with scroll list and right click.
- Moar things incredible!!!

Screenshots :
SpoilerNote : The screenshots are not reprensatative of the final version.
Boot screen :

Login Panel :

Desktop :


CubeXplorer

superaxander #2
Posted 28 March 2013 - 04:18 AM
This look awesome
kornichen #3
Posted 28 March 2013 - 06:15 AM
Nice :)/>
Desktop reminds me at Turbo Pascal IDE in DOS.