# TEMPORARY, NEVER EVER RELY ON IT.

import sjfs

def unlink(lid=-1, path=None):
    if lid != -1 and path is not None:
        return #Ambigious parameters
    fid = sjfs.get_fid(lid, path)
    if lid == -1:
        lid = sjfs.get_lid(path)
    if fid == 0 and not sjfs.file_exists(fid):
        raise sjfs.IOError(sjfs.SJFS_NOTFOUND, 'File not found.')
    sjfs.unlink(lid)

def list_files(path=None):
    if not path:
        path = '/'
    try:
        sjfs.set_current_chroot(sjfs.SJFS_BASEDIR)
        did = sjfs.get_did(path)
        if not did:
            return []
        values = sjfs.get_all_file_values_in_dir(did, False)
        links = values['dir']['links']
        final_links = []
        for link in links:
            updated_link = dict(link)
            updated_link.update({'size': values['files'][link['fid']]['size']})
            final_links.append(updated_link)
    finally:
        sjfs.set_current_chroot('/')
    return final_links

def get_free_space(path=sjfs.SJFS_BASEDIR):
    import os
    fsinfo = os.statvfs(path)
    free = fsinfo.f_bfree * fsinfo.f_frsize
    return free

def get_used_space(path=sjfs.SJFS_BASEDIR):
    import os
    fsinfo = os.statvfs(path)
    total = fsinfo.f_blocks * fsinfo.f_frsize
    free = fsinfo.f_bfree * fsinfo.f_frsize
    return total - free

@@ -390,27 +390,44 @@
 es(path=None
+, full_data=False
 ):%0A
-
     if not p
@@ -685,16 +685,48 @@
 links'%5D%0A
+        files = values%5B'files'%5D%0A
         
@@ -803,24 +803,24 @@
  dict(link)%0A
-
             
@@ -887,16 +887,423 @@
 ize'%5D%7D)%0A
+            if full_data:%0A                updated_link.update(%7B%0A                    'date'  : files%5Blink%5B'fid'%5D%5D%5B'categories'%5D%5B'common'%5D.get('%25d-creation_date' %25 link%5B'fid'%5D, 0),%0A                    'type'  : files%5Blink%5B'fid'%5D%5D%5B'categories'%5D%5B'common'%5D.get('type', 'No type defined.'),%0A                    'md5'   : files%5Blink%5B'fid'%5D%5D%5B'categories'%5D%5B'common'%5D.get('md5', 'No md5 defined'),%0A                %7D)%0A
         

Use internal list_files instead of sjfs get_links, to increase welcome page display speed.