Guest User

Untitled

a guest
Aug 5th, 2020
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ php filesystem.php test_fs_link_and_unlink
  2.  
  3.  
  4. ------- fs state after: Initialized -------
  5. - null => forest
  6. - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  7. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  8. - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  9.  
  10. ino --> fs_inode_local:
  11. 3 => {"ino":3,"tree_id":1000,"ref_count":1,"links":1,"is_file":false}
  12.  
  13. uuid --> fs_inode_local:
  14. 1000 => {"ino":3,"tree_id":1000,"ref_count":1,"links":1,"is_file":false}
  15. ------- end state -------
  16.  
  17.  
  18. ------- fs state after: Hard-link created -------
  19. - null => forest
  20. - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  21. - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  22. - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  23. - 1006 => {"name":"homework.txt","inode_id":1005}
  24. - 1007 => {"name":"homework-link.txt","inode_id":1005}
  25. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  26. - 1005 => {"size":0,"ctime":1596669516,"mtime":1596669516,"kind":"file","content":null}
  27. - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  28.  
  29. ino --> fs_inode_local:
  30. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  31. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  32. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  33. 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":2,"is_file":true}
  34.  
  35. uuid --> fs_inode_local:
  36. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  37. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  38. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  39. 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":2,"is_file":true}
  40. ------- end state -------
  41.  
  42.  
  43. ------- fs state after: Original file removed -------
  44. - null => forest
  45. - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  46. - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  47. - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  48. - 1007 => {"name":"homework-link.txt","inode_id":1005}
  49. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  50. - 1005 => {"size":0,"ctime":1596669516,"mtime":1596669516,"kind":"file","content":null}
  51. - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  52. - 1006 => null
  53.  
  54. ino --> fs_inode_local:
  55. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  56. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  57. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  58. 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":true}
  59.  
  60. uuid --> fs_inode_local:
  61. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  62. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  63. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  64. 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":true}
  65. ------- end state -------
  66.  
  67.  
  68. ------- fs state after: Hard-linked file removed -------
  69. - null => forest
  70. - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  71. - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  72. - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  73. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  74. - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
  75. - 1006 => null
  76. - 1007 => null
  77. - 1005 => null
  78.  
  79. ino --> fs_inode_local:
  80. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  81. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  82. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  83.  
  84. uuid --> fs_inode_local:
  85. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  86. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  87. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  88. ------- end state -------
  89.  
  90.  
  91. =================================================================================
  92.  
  93.  
  94. $ php filesystem.php test_fs_readdir
  95.  
  96.  
  97. ------- fs state after: Home dir created -------
  98. - null => forest
  99. - 1000 => {"name":"root","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  100. - 1003 => {"name":"home","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  101. - 1004 => {"name":"bob","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  102. - 1005 => {"name":"projects","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  103. - 1007 => {"name":"homework.txt","inode_id":1006}
  104. - 1008 => {"name":"homework-link.txt","inode_id":1006}
  105. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  106. - 1006 => {"size":0,"ctime":1596669564,"mtime":1596669564,"kind":"file","content":null}
  107. - 1002 => {"name":"trash","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
  108.  
  109. ino --> fs_inode_local:
  110. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  111. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  112. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  113. 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  114. 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  115.  
  116. uuid --> fs_inode_local:
  117. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  118. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  119. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  120. 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  121. 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  122. ------- end state -------
  123.  
  124.  
  125. {"name":"projects","ino":6}
  126. {"name":"homework.txt","ino":7}
  127. {"name":"homework-link.txt","ino":7}
  128.  
  129.  
  130.  
  131.  
  132. ==================================================================================
  133.  
  134.  
  135. $ php filesystem.php test_fs_write_and_read
  136.  
  137.  
  138. ------- fs state after: filetree.conf written -------
  139. - null => forest
  140. - 1000 => {"name":"root","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
  141. - 1003 => {"name":"etc","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
  142. - 1005 => {"name":"filetree.conf","inode_id":1004}
  143. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
  144. - 1004 => {"size":0,"ctime":1596669595,"mtime":1596669595,"kind":"file","content":"line1\nline2\nline3\n"}
  145. - 1002 => {"name":"trash","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
  146.  
  147. ino --> fs_inode_local:
  148. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  149. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  150. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":true}
  151.  
  152. uuid --> fs_inode_local:
  153. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  154. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  155. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":true}
  156. ------- end state -------
  157.  
  158.  
  159. -- contents of /etc/filetree.conf --
  160. line1
  161. line2
  162. line3
  163.  
  164.  
  165.  
  166.  
  167.  
  168. ===============================================================================
  169.  
  170.  
  171. $ php filesystem.php test_fs_rename
  172.  
  173.  
  174. ------- fs state after: Home dir created -------
  175. - null => forest
  176. - 1000 => {"name":"root","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  177. - 1003 => {"name":"home","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  178. - 1004 => {"name":"bob","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  179. - 1005 => {"name":"projects","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  180. - 1007 => {"name":"homework.txt","inode_id":1006}
  181. - 1008 => {"name":"homework-link.txt","inode_id":1006}
  182. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  183. - 1006 => {"size":0,"ctime":1596669624,"mtime":1596669624,"kind":"file","content":null}
  184. - 1002 => {"name":"trash","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  185.  
  186. ino --> fs_inode_local:
  187. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  188. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  189. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  190. 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  191. 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  192.  
  193. uuid --> fs_inode_local:
  194. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  195. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  196. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  197. 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  198. 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  199. ------- end state -------
  200.  
  201.  
  202.  
  203.  
  204. ------- fs state after: Files and directory renamed/moved -------
  205. - null => forest
  206. - 1000 => {"name":"root","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  207. - 1003 => {"name":"home","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  208. - 1004 => {"name":"bob","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  209. - 1007 => {"name":"renamed.txt","inode_id":1006}
  210. - 1005 => {"name":"projects_moved","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  211. - 1008 => {"name":"moved_and_renamed.txt","inode_id":1006}
  212. - 1001 => {"name":"fileinodes","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  213. - 1006 => {"size":0,"ctime":1596669624,"mtime":1596669624,"kind":"file","content":null}
  214. - 1002 => {"name":"trash","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
  215.  
  216. ino --> fs_inode_local:
  217. 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  218. 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  219. 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  220. 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  221. 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  222.  
  223. uuid --> fs_inode_local:
  224. 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
  225. 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
  226. 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
  227. 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
  228. 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
  229. ------- end state -------
  230.  
  231.  
  232.  
  233.  
  234.  
RAW Paste Data