-
Notifications
You must be signed in to change notification settings - Fork 0
/
hand.py
178 lines (126 loc) · 3.62 KB
/
hand.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import ram
import dbg
from mount import start
from create import makeFile
from move import move
from delete import deleteFile
from ls import ls
from chDir import chDir
from dir_table import get_dir_table
from OpenFile import Open
from hard_write import hardWrite
from call import *
"""
SHOW PARENT
make dictionary of errors where key is status and value is correspong error function,
on key = 0, print second string, else call error
Change ls to return string
send status and
ls should return a string where each item is space separated
and directories and files are - separated
Change freeBlocks
send status and
send - blocks left and out_if scope block
Change Master block
send status, master block string
do everything
USE ram.current_inode to create the illusion for each user being in separate directory simultaneously
"""
start()
cmakeFile(ram.current_inode, "f1", 0)
# print(showMasterBlock())
# print(freeBlocks())
# a = cls(ram.current_inode)
# a = a.split('-')
# print(a)
# exit(0)
# cOpen("f1", 0)
cwrite("f1","aha wow cool", 0)
# print(cread("f1", 0, -1))
# cls(ram.current_inode, True)
# print(cmemmap())
# csaveChanges("xx2",True)
# print(blocksConsumed("f1"))
# print(cshow_data())
# print(cshow_data())
# cdelete("f1", ram.current_inode)
# cls(ram.current_inode)
# ram.oft["f1"].write("abcdefg",0)
# trwt( "f1", 0, ram.current_inode,[0, -1] )
def r():
trwt( "f1", 1, ram.current_inode,[0, "o fuck my life g"] )
r();
print("aha")
# trwt( "f1", 1, ram.current_inode,[0, "o fuck my life g"] )
# trwt( "f1", 0, ram.current_inode,[0, -1] )
# trwt( "f1", 2, ram.current_inode,[6] )
# trwt( "f1", 0, ram.current_inode,[0, -1] )
exit()
# trwt( "f1", 1, [0, "Ok fuck me=y life"] )
# trwt( "f1", 2, [6] )
# trwt( "f1", 0, [0, -1] )
# trwt( fname, method, arguments )
# print(ram.oft["f1"].read(0,-1))
exit(0)
# ls(ram.current_inode)
# openedFile = cOpen("f1", thread = True);
# openedFile.write("abc",0)
# makeFile(ram.current_inode, "f1", 0)
# openedFile = Open("f1");
# openedFile.write("abc",0)
# # openedFile.truncate(2)
# text = openedFile.read(0,4)
# print(type(ram.inode_table[0][9][0]))
# hardWrite("newt")
# print(type(ram.inode_table[0][9][0]))
# makeFile(ram.current_inode, "f1", 0)
# ls(ram.current_inode)
# exit(0)
# # makeFile(ram.current_inode, "f3", 0)
# ls(ram.current_inode)
# print(text)
# exit(0)
# # makeFile(ram.current_inode, "f2")
# from mount import out_scope_block
# print(ram.current_inode)
# ls(ram.current_inode)
# for inode in ram.inode_table:
# print(inode)
# for data in dbg.data:
# print(data)
# # print(ram.parents_stack)
# # print(ram.current_inode);
# chDir("f1",ram.current_inode);
# print(ram.current_inode)
# ls(ram.current_inode)
# for inode in ram.inode_table:
# print(inode)
# for data in dbg.data:
# print(data)
# exit(0)
# makeFile(ram.current_inode, "f1")
# print(ram.parents_stack)
# print(ram.current_inode);
# print(ram.parents_stack)
# print(ram.current_inode);
# chDir("..",ram.current_inode);
# makeFile(ram.current_inode, "f1")
# print(ram.parents_stack)
# print(ram.current_inode);
# print(ram.free_blocks)
# for inode in ram.inode_table:
# print(inode)
# for data in dbg.data:
# print(data)
# print("")
# move("f1","f2", ram.current_inode)
# print(ram.free_blocks)
# for inode in ram.inode_table:
# print(inode)
# for data in dbg.data:
# print(data)
# deleteFile("f2",ram.current_inode)
# for inode in ram.inode_table:
# print(inode)
# for data in dbg.data:
# print(data)