Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ php filesystem.php test_fs_link_and_unlink
- ------- fs state after: Initialized -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":1,"links":1,"is_file":false}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":1,"links":1,"is_file":false}
- ------- end state -------
- ------- fs state after: Hard-link created -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1006 => {"name":"homework.txt","inode_id":1005}
- - 1007 => {"name":"homework-link.txt","inode_id":1005}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1005 => {"size":0,"ctime":1596669516,"mtime":1596669516,"kind":"file","content":null}
- - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":2,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":2,"is_file":true}
- ------- end state -------
- ------- fs state after: Original file removed -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1007 => {"name":"homework-link.txt","inode_id":1005}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1005 => {"size":0,"ctime":1596669516,"mtime":1596669516,"kind":"file","content":null}
- - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1006 => null
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":true}
- ------- end state -------
- ------- fs state after: Hard-linked file removed -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1002 => {"name":"trash","size":0,"ctime":1596669516,"mtime":1596669516,"kind":"dir"}
- - 1006 => null
- - 1007 => null
- - 1005 => null
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- ------- end state -------
- =================================================================================
- $ php filesystem.php test_fs_readdir
- ------- fs state after: Home dir created -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- - 1005 => {"name":"projects","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- - 1007 => {"name":"homework.txt","inode_id":1006}
- - 1008 => {"name":"homework-link.txt","inode_id":1006}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- - 1006 => {"size":0,"ctime":1596669564,"mtime":1596669564,"kind":"file","content":null}
- - 1002 => {"name":"trash","size":0,"ctime":1596669564,"mtime":1596669564,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- ------- end state -------
- {"name":"projects","ino":6}
- {"name":"homework.txt","ino":7}
- {"name":"homework-link.txt","ino":7}
- ==================================================================================
- $ php filesystem.php test_fs_write_and_read
- ------- fs state after: filetree.conf written -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
- - 1003 => {"name":"etc","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
- - 1005 => {"name":"filetree.conf","inode_id":1004}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
- - 1004 => {"size":0,"ctime":1596669595,"mtime":1596669595,"kind":"file","content":"line1\nline2\nline3\n"}
- - 1002 => {"name":"trash","size":0,"ctime":1596669595,"mtime":1596669595,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":true}
- ------- end state -------
- -- contents of /etc/filetree.conf --
- line1
- line2
- line3
- ===============================================================================
- $ php filesystem.php test_fs_rename
- ------- fs state after: Home dir created -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1005 => {"name":"projects","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1007 => {"name":"homework.txt","inode_id":1006}
- - 1008 => {"name":"homework-link.txt","inode_id":1006}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1006 => {"size":0,"ctime":1596669624,"mtime":1596669624,"kind":"file","content":null}
- - 1002 => {"name":"trash","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- ------- end state -------
- ------- fs state after: Files and directory renamed/moved -------
- - null => forest
- - 1000 => {"name":"root","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1003 => {"name":"home","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1004 => {"name":"bob","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1007 => {"name":"renamed.txt","inode_id":1006}
- - 1005 => {"name":"projects_moved","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1008 => {"name":"moved_and_renamed.txt","inode_id":1006}
- - 1001 => {"name":"fileinodes","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- - 1006 => {"size":0,"ctime":1596669624,"mtime":1596669624,"kind":"file","content":null}
- - 1002 => {"name":"trash","size":0,"ctime":1596669624,"mtime":1596669624,"kind":"dir"}
- ino --> fs_inode_local:
- 3 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 4 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 5 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 6 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 7 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- uuid --> fs_inode_local:
- 1000 => {"ino":3,"tree_id":1000,"ref_count":2,"links":1,"is_file":false}
- 1003 => {"ino":4,"tree_id":1003,"ref_count":1,"links":1,"is_file":false}
- 1004 => {"ino":5,"tree_id":1004,"ref_count":1,"links":1,"is_file":false}
- 1005 => {"ino":6,"tree_id":1005,"ref_count":1,"links":1,"is_file":false}
- 1006 => {"ino":7,"tree_id":1006,"ref_count":1,"links":2,"is_file":true}
- ------- end state -------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement