Slide 7.1: Variable-length record addition demonstrations Slide 7.3: Variable-length record addition demonstrations (cont.) Home |
avail.txt
into the following file avail1.txt
:
-1 531 76 12 File Structures: An Object-Oriented Approach with C++|0201874016|94.80|360| 46 100 Learning WML & WMLScript|1565929470|17.48|12| 52 158 XML in a Nutshell, 2nd Edition|0596002920|39.95|39| 36 222 Java and XSLT|0596001436|26.37|890| 82 270 WAP Servlets: Developing Dynamic Web Content With Java and WML|047139307|32.99|4| 60 364 WAP Development with WML and WMLScript|0672319462|18.99|56| 83 436 Advances in Security and Payment Methods for Mobile Commerce|1591403456|89.95|182| 76 531 M Commerce: Technologies, Services, and Business Models|0471135852|23.09|5|where
head/last/offsets
takes five bytes.
head+' '+last+'\n'
where head
is the head (offset) of the avail list
and last
is the offset of the last record.
length+' '+offset+' '
where
length
is the actual record length including '\n'
but not including the length+' '+offset+' '
, and
offset
is the disk offset right before the length
.
avail2.txt
:
222 531 76 12 File Structures: An Object-Oriented Approach with C++|0201874016|94.80|360| 46 100 *|-1 WML & WMLScript|1565929470|17.48|12| 52 158 XML in a Nutshell, 2nd Edition|0596002920|39.95|39| 36 222 *|436 XSLT|0596001436|26.37|890| 82 270 WAP Servlets: Developing Dynamic Web Content With Java and WML|047139307|32.99|4| 60 364 WAP Development with WML and WMLScript|0672319462|18.99|56| 83 436 *|100 in Security and Payment Methods for Mobile Commerce|1591403456|89.95|182| 76 531 M Commerce: Technologies, Services, and Business Models|0471135852|23.09|5|