[BOOTDATA]: Diverse improvements for mkisofs support and ISO image configuration:
[reactos.git] / reactos / sdk / tools / mkisofs / schilytools / mkisofs / README.sort
1 Sort the order of file data on the CD
2 =====================================
3
4 Note: this option does not sort the order of the file names that appear
5 in the ISO9660 directory. It sorts the order in which the file data is
6 written to the CD image.
7
8 This option is useful in order to optimize the data layout on a CD.
9
10 To use, type something like:
11
12 mkisofs -o cdimage.iso -sort sort_file [other_options] cd_dir
13
14 The file 'sort_file' contains two columns of:
15
16 filename weight
17
18 where filename is the whole name of a file/directory as mkisofs will see it
19 and weight is a whole number between +/- 2147483647
20
21 The files will be sorted with the highest weights first and lowest last.
22 The default weight is zero.
23
24 If the filename is a directory name, then all the files in that directory (and
25 sub-directories) will use its weight as their default weight.
26
27 e.g.
28
29 If the directory 'cd_dir' contains two directories called 'dir1' and 'dir2'
30 with files 'A', 'B' and 'C' in dir1 and 'X', 'Y' and 'Z', the the file
31 'sort_file' could look something like:
32
33 cd_dir/dir2 1000
34 cd_dir/dir2/Y 2000
35 cd_dir/dir1/B -2000
36 cd_dir/dir1/A -8000
37
38 Note: There must be only one space or tab character between the filename and
39 the weight and the weight must be the last characters on a line. The filename
40 is taken to include all the characters from the first in a line, up to, but
41 not including the last space or tab character on a line. This is to allow
42 for space characters to be in, or at the end of a filename.
43
44
45 The command:
46
47 mkisofs -o cdimage.iso -sort sort_file cd_dir
48
49 will sort the above file data as:
50
51 cd_dir/dir2/Y
52 cd_dir/dir2/X
53 cd_dir/dir2/Z
54 cd_dir/dir1/C
55 cd_dir/dir1/B
56 cd_dir/dir1/A
57
58 Note: files 'X' and 'Z' both have the weight 1000 - their sort order will then
59 be the normal ISO9660 sort order (i.e. alphabetical in this case).
60
61 File C will have the default weight of 0
62
63 Warning: the filenames in the sort list MUST match the whole path as seen by
64 mkisofs. i.e. in the above case, if the command line was:
65
66 mkisofs -o cdimage.iso -sort sort_file ./cd_dir
67
68 then the sort_file filename will have to changed as accordingly.
69
70 Notes
71 =====
72
73 CDs are written from the middle outwards. High weighted files will be nearer
74 the inside of the CD.
75
76 Wildcards in the filename list should work.
77
78 If a file appears more than once in the source directory tree, then the file
79 is only added once to the CD image - i.e. a hard linked file, or symbolic
80 link if using the -f option. The file will be sorted according to the
81 highest weighting given to any of the linked files.
82
83 Zero length files are not sorted - the 'start extent' *may* appear to be in
84 the middle of another file after sorting. This is because zero length files
85 are given the start extent after the last file added to the CD at that time.
86 This address is not changed by the sorting, so it may appear that the file
87 address is in another file - however as they are zero length, this will
88 not matter!
89
90 Directories are not sorted by this flag - directories HAVE to be in the
91 ISO9660 sort order - however, the files the directory entry points to, can be
92 anywhere on the CD.
93
94 Existing files from any previous sessions will not be sorted - they already
95 exist on the CD and can not be moved!
96
97 I have no idea if this is really useful ...
98
99
100 James Pearson 22-Nov-2001
101
102 Any comments/problems to j.pearson@ge.ucl.ac.uk