Quantcast
Channel: I'M FROSTY
Viewing all articles
Browse latest Browse all 120

Write A Python Program For Creating Virtual File System on Linux Environment.

$
0
0

============ Python Program ============

Virtual file system VFS.

import shelve
import system

fs = shelve.open('filesystem.fs', writeback=True)
current_dir = []

def install(fs):


         # create root and others
    username = raw_input('What do you want your username to be? ')

    fs[""] = {"System": {}, "Users": {username: {}}}

def current_dictionary():
    """Return a dictionary representing the files in the current directory"""
    d = fs[""]
    for key in current_dir:
        d = d[key]
    return d


Read more »

Viewing all articles
Browse latest Browse all 120

Trending Articles