File system sector links Sector File# Link Data (sample) 1 0001 7 0011 010100100101.... 2 0010 0 3 0011 7 0111 010010111101... 4 0100 6 0100 101001010001... 5 0101 3 1011 101001010010... 6 0110 7 0100 100101001100... 7 0111 7 0110 010010101010... Sector 2 is not used. In this example it is shown as blank for clarity but would in fact be linked into a file number which is used for collection of free space and from which sectors are transferred when needed for data storage. Sector 5 is used by file number 5. Sectors 1,3,4,6, and 7 are used by file number 7. When the file is opened, the SectorPointer is set to the StartingSector and PreviousSector is set to zero. To move forward in the chain then following steps are taken: 1. SectorPointer := File. StartingSector /*0001*/; PreviousSector := 0; 2. Temp := PreviousSector /*0000*/ XOR SectorPointer.link /*0011*/; PreviousSector := SectorPointer /*0001*/; SectorPointer := Temp /*0011*/; 3. Temp := PreviousSector /*0001*/ XOR SectorPointer.link /*0111*/; PreviousSector := SectorPointer /*0011*/; SectorPointer := Temp /*0110*/; 4. Temp := PreviousSector /*0011*1 XOR SectorPointer.link /*0100*/; PreviousSector SectorPointer /*0110*/; SectorPointer := Temp /*0111*/; 5. Temp := PreviousSector /*0110*/ XOR SectorPointer.link /*0110*/; PreviousSector SectorPointer /*0111*/; SectorPointer := Temp /*0000*/; At this point the SectorPointer is Zero indicating that the end of the file has been reached. To traverse the file in reverse order SectorPointer is set to the EndingSector and PreviousSector is set to zero. To move backward in the chain then following steps are taken: 1. SectorPointer := File.EndinSSector /*0111*/; PreviousSector := 0; 2. Temp := PreviousSector /*0000*/ XOR SectorPointer.link /*01101/; PreviousSector SectorPointer /*0111*/; SectorPointer := Temp /*0110*/; 3. Temp := PreviousSector /*0111*/ XOR SectorPointer.link /*0100*/; PreviousSector SectorPointer /*01101/; SectorPointer := Temp /*0011*/; 4. Temp := PreviousSector /*0110*/ XOR SectorPointer.link /*0111*/; PreviousSector SectorPointer /*0011*/; SectorPointer := Temp /*0001*/; 5. Temp := PreviousSector /*0011*/ XOR SectorPointer.link /*0011*/; PreviousSector SectorPointer /*0001*/; SectorPointer := Temp /*0000*/; At this point the SectorPointer is Zero indicateing that the start of the file has been reached.
file: /Techref/language/meta-l/fs.htm, 2KB, , updated: 1999/10/11 11:51, local time: 2024/12/18 20:55,
18.188.247.82:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/language/meta-l/fs.htm"> language meta-l fs</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.