<reponame>Beriff/openVBS<gh_stars>0
import datetime

print("OVBS OS 0.2.5 By Beriff")

uniqueUnionName = 0

def readfile(name):
    f = open(name, "r")

    content = f.read()

    f.close()

    return content

#selected files handler
selected = []

#all accessable files here
workspace = []

#standard folder
root = []

#current directory
currentDir = 0

#amount of directories taken by created folders.
#increases with every folder creation. Allows to set unique int to every folder.
takenFolders = 0

pmpfc = 0 #means: prevent multiple print function calling

#User Input
usrInput = None

#Include standard folder to workspace
workspace.append(root)

#this list used by "help" command
commands = ["sd", "help", "view [filename]", "add [filename]", "del [filename]", "list [folderID]", "crt", "dp [filename]", "folder [foldername]", "goto [foldername]", "finp", "info [filename]", "sfcr", "unite [filename | filename]", "getid", "idgoto [FID]", "back", "rnm [filename]"]

#used to select a file in inputDefine() func. Alternative of usrInput
fileDef = None

#used to store file creation date
now = datetime.datetime.now()

#file creating classes 

##used to create file by system
class vbs_file:

    def __init__(self, nameArg, contArg, typeArg):
        self.file_name = nameArg
        self.file_content = contArg
        self.file_type = typeArg
        self.crdate = "SYSTEM MADE FILE"

##used to create file using user's input
class vbs_file_user:

    def __init__(self):
        self.file_name = input("enter file name \n")
        self.file_type = "text"
        self.file_content = input("enter file content\n")
        self.crdate = str(now.year) + "." + str(now.month) + "." + str(now.day) + " " + str(now.hour) + ":" + str(now.minute) + ":" + str(now.second)

##used to create folder using user's input
class vbs_user_folder:

    def __init__(self):
        self.file_name = input("enter folder name\n")
        self.file_type = "folder"
        self.key = takenFolders
        self.inner = []

class vbs_safe_user_file:
    def __init__(self):
        self.file_name = input("enter file name \n")
        self.file_type = "safe"
        self.file_content = input("enter file content\n")
        self.crdate = str(now.year) + "." + str(now.month) + "." + str(now.day) + " " + str(now.hour) + ":" + str(now.minute) + ":" + str(now.second)
        self.password = input("enter password\n")


#starting file creation & including

hello = vbs_file("getting_started", "Write 'help' to list all avaible commands. Try to edit or delete this file too using edt and del commands!", "text")
workspace[currentDir].append(hello)

new_file = None




#defining user input

def inputDefine():

    global currentDir
    global pmpfc
    global usrInput
    global fileDef
    global takenFolders
    global new_file
    global now
    global uniqueUnionName

    #opening a file mode
    if usrInput.startswith("view"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("enter file name:\n")

        inputStorage = []

        i = 0
        isFound = False
        

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    print("\n")

                    print(workspace[currentDir][i].file_content)

                    print("\n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if workspace[currentDir][i].password == reqpass:

                        print(workspace[currentDir][i].file_content)

                        isFound = True

                    if workspace[currentDir][i].password != reqpass:

                        print("passwords does not match!")

                        isFound = True

                else:
                    i += 1
        except:
            print("file was not found\n")

    #rewriting file mode
    if usrInput.startswith("rwr"):
        
        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("Select a file \n")

        inputStorage = []

        i = 0
        isFound = False

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    workspace[currentDir][i].file_content = input("Rewrite a file: \n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if reqpass == workspace[currentDir][i].password:

                        workspace[currentDir][i].file_content = input("Rewrite a file: \n")

                        isFound = True

                    else:
                        print("passwords does not match!\n")
                        isFound = True
                        break

                else:
                    i += 1
        except:
            print("file was not found\n") 

    #adding content to file
    if usrInput.startswith("add"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("Select a file \n")

        i = 0
        isFound = False

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    workspace[currentDir][i].file_content = workspace[currentDir][i].file_content + input("Add content to a file: \n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if reqpass == workspace[currentDir][i].password:

                        workspace[currentDir][i].file_content = workspace[currentDir][i].file_content + input("Add content to a file: \n")

                        isFound = True

                    if reqpass != workspace[currentDir][i].password:

                        print("passwords does not match!\n")
                        isFound = True

                else:
                    i += 1 
        except:
            print("file was not found \n")

    #listing all elements of current folder
    if usrInput.startswith("list"):

        fidHolder = usrInput.split()

        try:
            selectedDir = fidHolder[1]
            selectedDir = int(selectedDir)
        except IndexError:
            selectedDir = currentDir
        try:
            print(str(len(workspace[selectedDir])) + " files in current directory\n")
        except IndexError:
            print("invalid folder ID. FID was changed to 0\n")
            selectedDir = 0

        try:
            for j in range(len(workspace[selectedDir])):
                if workspace[currentDir][j].file_type == "text":
                    print(workspace[selectedDir][j].file_name)
                if workspace[selectedDir][j].file_type == "folder":
                    print(workspace[selectedDir][j].file_name + " [FOLDER]")
        except IndexError:
            
            j = 0

            while j < len(workspace[selectedDir]):

                if workspace[selectedDir][j].file_type == "text":
                    print(workspace[selectedDir][j].file_name)
                if workspace[selectedDir][j].file_type == "folder":
                    print(workspace[selectedDir][j].file_name + " [FOLDER]")

                j += 1
        
        print("\n")
        


    #create a file. VERY buggy thing
    if usrInput == "crt":

        now = datetime.datetime.now()
        new_file = vbs_file_user()
        workspace[currentDir].append(new_file)

        print("File was created \n")
        

    #delete file. VERY buggy thing too
    if usrInput.startswith("del"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a file to delete \n")

        inputStorage = []

        i = 0
        isFound = False

        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name:

                    workspace[currentDir].remove(workspace[currentDir][i])

                    print("file was deleted \n")

                    isFound = True

                else:
                    i += 1 
        except:
            print("file was not found \n")

    if usrInput == "help":

        print("\n")

        for x in commands:
            print(x)

    #duplicate a file
    if usrInput.startswith("dp"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a file to duplicate\n")

        
        i = 0
        isFound = False

        
        while isFound != True:

            try:

                if fileDef == workspace[currentDir][i].file_name:

                    copied_file = vbs_file("notst", "notst", "notst")

                    copied_file.file_content = workspace[currentDir][i].file_content
                    copied_file.file_type = workspace[currentDir][i].file_type
                    copied_file.file_name = input("write a new file name.\n")
                    workspace[currentDir].append(copied_file)

                    print("\n")

                    isFound = True

                else:
                    i += 1 

            except:
                print("An error occured while duplicating a file.\n")

    #create folder. all bugs fixed with that thing?
    if usrInput.startswith("folder"):

        try:
            newFolder = vbs_user_folder()
            workspace[currentDir].append(newFolder)
            takenFolders += 1
            newFolder.key = takenFolders
            workspace.append(newFolder.inner)
        except:
            print("an error occured while creating new folder\n")

    #go to selected folder. Not a buggy thing anymore
    if usrInput.startswith("goto"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a folder \n")
        
        isFound = False
        i = 0


        while isFound != True:

            try:

                if fileDef == workspace[currentDir][i].file_name:

                    pmpfc = 0

                    currentDir = workspace[currentDir][i].key

                    isFound = True

                    

                    
                else:
                    i += 1
                
            except IndexError:
                print("folder was not found! \n")
                break


    #back to root folder.
    if usrInput =="back":

        
        currentDir = 0

        print("you was moved back to root folder \n")

    if usrInput == "rnm":

        i = 0
        isFound = False

        fileDef = input("select a file to rename\n")

        while isFound != True:

            try:
                if fileDef == workspace[currentDir][i].file_name:

                    fileDef = input("set a new name\n")

                    workspace[currentDir][i].file_name = fileDef

                    isFound = True

                else:
                    i += 1
            except IndexError:
                print("file was not found \n")
                break

    #import file from outside
    if usrInput == "finp":

        try:
            fileDef = input("enter file name\n")

            fcont = readfile(fileDef)

            new_file = vbs_file(fileDef, fcont , "text")


            workspace[currentDir].append(new_file)

        except FileNotFoundError:
            print("the file was not found")

    #file info. not done yet.
    if usrInput == "info":

        try:
            fileDef = input("enter file name\n")
            isFound = False
            i = 0

            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name:

                    print("file was created on " + workspace[currentDir][i].crdate + "\n")
                    isFound = True

                else:
                    i += 1

        except IndexError:
            print("file was not found\n")

    #safe file creation
    if usrInput == "sfcr":

        now = datetime.datetime.now()
        new_file = vbs_safe_user_file()
        workspace[currentDir].append(new_file)


    if usrInput == "cp":

        z = 0
        i = 0
        isFound = False
        
        fileCount = input("how many files you want to copy?\n")


        while z < int(fileCount):

            selected = [] #resetting copy buffer
            fileDef = input("enter file name\n")

            while isFound != True:

                try:
                    if fileDef == workspace[currentDir][i].file_name:

                        selected.append(workspace[currentDir][i])
                        z += 1
                        isFound = True

                    else:
                        i += 1

                except IndexError:
                    print("file was not found!\n")

            print("copied\n")

            isFound = False

                
                  
                
    if usrInput == "pst":
		
        i = 0
		
        while i != len(selected):
			
            workspace[currentDir].append(selected[i])
            i += 1
        
        print("pasted\n")

    if usrInput.startswith("unite"):

        inputStorage = usrInput.split()


        a = 0
        b = 0
        isFound = False
        

        try:
            unit1 = inputStorage[1]
        except IndexError:
            unit1 = input("first file name\n")

        try:
            unit2 = inputStorage[2]
        except IndexError:
            unit2 = input("second file name\n")

        while isFound != True:

            try:
                if unit1 == workspace[currentDir][a].file_name:
                    isFound = True

                else:
                    a += 1
            except IndexError:
                print("file 1 was not found\n")

        isFound = False

        while isFound != True:
            
            try:
                if unit2 == workspace[currentDir][b].file_name:
                    isFound = True

                else:
                    b += 1
            except IndexError:
                print("file 2 was not found\n")

        uniteValue = workspace[currentDir][a].file_content + " " + workspace[currentDir][b].file_content
        uniqueUnionName += 1
        unionName = "union_" + str(uniqueUnionName)

        new_file = vbs_file(unionName, uniteValue, "text")
        workspace[currentDir].append(new_file)

    if usrInput.startswith("getid"):
        print("\ncurrent FID: ")
        print(currentDir)

    if usrInput.startswith("idgoto"):

        inputStorage = usrInput.split()

        try:
            currentDir = int(inputStorage[1])
        except IndexError:
            print("FID not exists or not set")
        except ValueError:
            print("Invalid FID")
    

            

    


#MAIN PROGRAMM LOOP

while usrInput != "sd":
    usrInput = input("Waiting for input \n")
    inputDefine()

import datetime

print("OVBS OS 0.2.5 By Beriff")

uniqueUnionName = 0

def readfile(name):
    f = open(name, "r")

    content = f.read()

    f.close()

    return content

#selected files handler
selected = []

#all accessable files here
workspace = []

#standard folder
root = []

#current directory
currentDir = 0

#amount of directories taken by created folders.
#increases with every folder creation. Allows to set unique int to every folder.
takenFolders = 0

pmpfc = 0 #means: prevent multiple print function calling

#User Input
usrInput = None

#Include standard folder to workspace
workspace.append(root)

#this list used by "help" command
commands = ["sd", "help", "view [filename]", "add [filename]", "del [filename]", "list [folderID]", "crt", "dp [filename]", "folder [foldername]", "goto [foldername]", "finp", "info [filename]", "sfcr", "unite [filename | filename]", "getid", "idgoto [FID]", "back", "rnm [filename]"]

#used to select a file in inputDefine() func. Alternative of usrInput
fileDef = None

#used to store file creation date
now = datetime.datetime.now()

#file creating classes 

##used to create file by system
class vbs_file:

    def __init__(self, nameArg, contArg, typeArg):
        self.file_name = nameArg
        self.file_content = contArg
        self.file_type = typeArg
        self.crdate = "SYSTEM MADE FILE"

##used to create file using user's input
class vbs_file_user:

    def __init__(self):
        self.file_name = input("enter file name \n")
        self.file_type = "text"
        self.file_content = input("enter file content\n")
        self.crdate = str(now.year) + "." + str(now.month) + "." + str(now.day) + " " + str(now.hour) + ":" + str(now.minute) + ":" + str(now.second)

##used to create folder using user's input
class vbs_user_folder:

    def __init__(self):
        self.file_name = input("enter folder name\n")
        self.file_type = "folder"
        self.key = takenFolders
        self.inner = []

class vbs_safe_user_file:
    def __init__(self):
        self.file_name = input("enter file name \n")
        self.file_type = "safe"
        self.file_content = input("enter file content\n")
        self.crdate = str(now.year) + "." + str(now.month) + "." + str(now.day) + " " + str(now.hour) + ":" + str(now.minute) + ":" + str(now.second)
        self.password = input("enter password\n")


#starting file creation & including

hello = vbs_file("getting_started", "Write 'help' to list all avaible commands. Try to edit or delete this file too using edt and del commands!", "text")
workspace[currentDir].append(hello)

new_file = None




#defining user input

def inputDefine():

    global currentDir
    global pmpfc
    global usrInput
    global fileDef
    global takenFolders
    global new_file
    global now
    global uniqueUnionName

    #opening a file mode
    if usrInput.startswith("view"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("enter file name:\n")

        inputStorage = []

        i = 0
        isFound = False
        

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    print("\n")

                    print(workspace[currentDir][i].file_content)

                    print("\n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if workspace[currentDir][i].password == reqpass:

                        print(workspace[currentDir][i].file_content)

                        isFound = True

                    if workspace[currentDir][i].password != reqpass:

                        print("passwords does not match!")

                        isFound = True

                else:
                    i += 1
        except:
            print("file was not found\n")

    #rewriting file mode
    if usrInput.startswith("rwr"):
        
        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("Select a file \n")

        inputStorage = []

        i = 0
        isFound = False

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    workspace[currentDir][i].file_content = input("Rewrite a file: \n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if reqpass == workspace[currentDir][i].password:

                        workspace[currentDir][i].file_content = input("Rewrite a file: \n")

                        isFound = True

                    else:
                        print("passwords does not match!\n")
                        isFound = True
                        break

                else:
                    i += 1
        except:
            print("file was not found\n") 

    #adding content to file
    if usrInput.startswith("add"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("Select a file \n")

        i = 0
        isFound = False

        #iterating loop
        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "text":

                    workspace[currentDir][i].file_content = workspace[currentDir][i].file_content + input("Add content to a file: \n")

                    isFound = True

                if fileDef == workspace[currentDir][i].file_name and workspace[currentDir][i].file_type == "safe":

                    reqpass = input("enter a password to access safe file\n")

                    if reqpass == workspace[currentDir][i].password:

                        workspace[currentDir][i].file_content = workspace[currentDir][i].file_content + input("Add content to a file: \n")

                        isFound = True

                    if reqpass != workspace[currentDir][i].password:

                        print("passwords does not match!\n")
                        isFound = True

                else:
                    i += 1 
        except:
            print("file was not found \n")

    #listing all elements of current folder
    if usrInput.startswith("list"):

        fidHolder = usrInput.split()

        try:
            selectedDir = fidHolder[1]
            selectedDir = int(selectedDir)
        except IndexError:
            selectedDir = currentDir
        try:
            print(str(len(workspace[selectedDir])) + " files in current directory\n")
        except IndexError:
            print("invalid folder ID. FID was changed to 0\n")
            selectedDir = 0

        try:
            for j in range(len(workspace[selectedDir])):
                if workspace[currentDir][j].file_type == "text":
                    print(workspace[selectedDir][j].file_name)
                if workspace[selectedDir][j].file_type == "folder":
                    print(workspace[selectedDir][j].file_name + " [FOLDER]")
        except IndexError:
            
            j = 0

            while j < len(workspace[selectedDir]):

                if workspace[selectedDir][j].file_type == "text":
                    print(workspace[selectedDir][j].file_name)
                if workspace[selectedDir][j].file_type == "folder":
                    print(workspace[selectedDir][j].file_name + " [FOLDER]")

                j += 1
        
        print("\n")
        


    #create a file. VERY buggy thing
    if usrInput == "crt":

        now = datetime.datetime.now()
        new_file = vbs_file_user()
        workspace[currentDir].append(new_file)

        print("File was created \n")
        

    #delete file. VERY buggy thing too
    if usrInput.startswith("del"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a file to delete \n")

        inputStorage = []

        i = 0
        isFound = False

        try:
            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name:

                    workspace[currentDir].remove(workspace[currentDir][i])

                    print("file was deleted \n")

                    isFound = True

                else:
                    i += 1 
        except:
            print("file was not found \n")

    if usrInput == "help":

        print("\n")

        for x in commands:
            print(x)

    #duplicate a file
    if usrInput.startswith("dp"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a file to duplicate\n")

        
        i = 0
        isFound = False

        
        while isFound != True:

            try:

                if fileDef == workspace[currentDir][i].file_name:

                    copied_file = vbs_file("notst", "notst", "notst")

                    copied_file.file_content = workspace[currentDir][i].file_content
                    copied_file.file_type = workspace[currentDir][i].file_type
                    copied_file.file_name = input("write a new file name.\n")
                    workspace[currentDir].append(copied_file)

                    print("\n")

                    isFound = True

                else:
                    i += 1 

            except:
                print("An error occured while duplicating a file.\n")

    #create folder. all bugs fixed with that thing?
    if usrInput.startswith("folder"):

        try:
            newFolder = vbs_user_folder()
            workspace[currentDir].append(newFolder)
            takenFolders += 1
            newFolder.key = takenFolders
            workspace.append(newFolder.inner)
        except:
            print("an error occured while creating new folder\n")

    #go to selected folder. Not a buggy thing anymore
    if usrInput.startswith("goto"):

        inputStorage = usrInput.split()

        try:
            fileDef = inputStorage[1]
        except IndexError:
            fileDef = input("select a folder \n")
        
        isFound = False
        i = 0


        while isFound != True:

            try:

                if fileDef == workspace[currentDir][i].file_name:

                    pmpfc = 0

                    currentDir = workspace[currentDir][i].key

                    isFound = True

                    

                    
                else:
                    i += 1
                
            except IndexError:
                print("folder was not found! \n")
                break


    #back to root folder.
    if usrInput =="back":

        
        currentDir = 0

        print("you was moved back to root folder \n")

    if usrInput == "rnm":

        i = 0
        isFound = False

        fileDef = input("select a file to rename\n")

        while isFound != True:

            try:
                if fileDef == workspace[currentDir][i].file_name:

                    fileDef = input("set a new name\n")

                    workspace[currentDir][i].file_name = fileDef

                    isFound = True

                else:
                    i += 1
            except IndexError:
                print("file was not found \n")
                break

    #import file from outside
    if usrInput == "finp":

        try:
            fileDef = input("enter file name\n")

            fcont = readfile(fileDef)

            new_file = vbs_file(fileDef, fcont , "text")


            workspace[currentDir].append(new_file)

        except FileNotFoundError:
            print("the file was not found")

    #file info. not done yet.
    if usrInput == "info":

        try:
            fileDef = input("enter file name\n")
            isFound = False
            i = 0

            while isFound != True:

                if fileDef == workspace[currentDir][i].file_name:

                    print("file was created on " + workspace[currentDir][i].crdate + "\n")
                    isFound = True

                else:
                    i += 1

        except IndexError:
            print("file was not found\n")

    #safe file creation
    if usrInput == "sfcr":

        now = datetime.datetime.now()
        new_file = vbs_safe_user_file()
        workspace[currentDir].append(new_file)


    if usrInput == "cp":

        z = 0
        i = 0
        isFound = False
        
        fileCount = input("how many files you want to copy?\n")


        while z < int(fileCount):

            selected = [] #resetting copy buffer
            fileDef = input("enter file name\n")

            while isFound != True:

                try:
                    if fileDef == workspace[currentDir][i].file_name:

                        selected.append(workspace[currentDir][i])
                        z += 1
                        isFound = True

                    else:
                        i += 1

                except IndexError:
                    print("file was not found!\n")

            print("copied\n")

            isFound = False

                
                  
                
    if usrInput == "pst":
		
        i = 0
		
        while i != len(selected):
			
            workspace[currentDir].append(selected[i])
            i += 1
        
        print("pasted\n")

    if usrInput.startswith("unite"):

        inputStorage = usrInput.split()


        a = 0
        b = 0
        isFound = False
        

        try:
            unit1 = inputStorage[1]
        except IndexError:
            unit1 = input("first file name\n")

        try:
            unit2 = inputStorage[2]
        except IndexError:
            unit2 = input("second file name\n")

        while isFound != True:

            try:
                if unit1 == workspace[currentDir][a].file_name:
                    isFound = True

                else:
                    a += 1
            except IndexError:
                print("file 1 was not found\n")

        isFound = False

        while isFound != True:
            
            try:
                if unit2 == workspace[currentDir][b].file_name:
                    isFound = True

                else:
                    b += 1
            except IndexError:
                print("file 2 was not found\n")

        uniteValue = workspace[currentDir][a].file_content + " " + workspace[currentDir][b].file_content
        uniqueUnionName += 1
        unionName = "union_" + str(uniqueUnionName)

        new_file = vbs_file(unionName, uniteValue, "text")
        workspace[currentDir].append(new_file)

    if usrInput.startswith("getid"):
        print("\ncurrent FID: ")
        print(currentDir)

    if usrInput.startswith("idgoto"):

        inputStorage = usrInput.split()

        try:
            currentDir = int(inputStorage[1])
        except IndexError:
            print("FID not exists or not set")
        except ValueError:
            print("Invalid FID")
    

            

    


#MAIN PROGRAMM LOOP

while usrInput != "sd":
    usrInput = input("Waiting for input \n")
    inputDefine()
#selected files handler #all accessable files here #standard folder #current directory #amount of directories taken by created folders. #increases with every folder creation. Allows to set unique int to every folder. #means: prevent multiple print function calling #User Input #Include standard folder to workspace #this list used by "help" command #used to select a file in inputDefine() func. Alternative of usrInput #used to store file creation date #file creating classes ##used to create file by system ##used to create file using user's input ##used to create folder using user's input #starting file creation & including #defining user input #opening a file mode #iterating loop #rewriting file mode #iterating loop #adding content to file #iterating loop #listing all elements of current folder #create a file. VERY buggy thing #delete file. VERY buggy thing too #duplicate a file #create folder. all bugs fixed with that thing? #go to selected folder. Not a buggy thing anymore #back to root folder. #import file from outside #file info. not done yet. #safe file creation #resetting copy buffer #MAIN PROGRAMM LOOP