Changeset 105 for trunk/src/lbatest/readsect.c
- Timestamp:
- Jun 7, 2011, 5:31:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lbatest/readsect.c
r104 r105 40 40 41 41 #define SECTOR_SIZE 512 42 #define SECTORS_PER_READ 20042 #define SECTORS_PER_READ 4 43 43 44 44 … … 53 53 54 54 /*--- global data -----------------------------------------------------------*/ 55 56 unsigned long sectors_per_read = SECTORS_PER_READ; 55 57 56 58 … … 98 100 } 99 101 } 102 103 if (argc > 4) { 104 sectors_per_read = (unsigned long) atoi(argv[4]); 105 if (sectors_per_read == 0) { 106 sectors_per_read = SECTORS_PER_READ; 107 } 108 } 109 110 printf("\nreadsect started; using %d sectors per read\n", 111 (int) sectors_per_read); 100 112 101 113 /* go */ … … 124 136 unsigned long sectors_read = 0; 125 137 126 buf = calloc(SECTOR_SIZE, SECTORS_PER_READ);138 buf = calloc(SECTOR_SIZE, sectors_per_read); 127 139 128 140 /* open drive */ … … 141 153 while (sectors_read < sectors_to_read) { 142 154 143 sectors_take = min(sectors_to_read - sectors_read, SECTORS_PER_READ);155 sectors_take = min(sectors_to_read - sectors_read, sectors_per_read); 144 156 cb_take = SECTOR_SIZE * sectors_take; 145 157 … … 187 199 "physical drive)\n\n" 188 200 "Usage:\n\n" 189 "lbatest <drive letter|drive number> <number of sectors to read> " 190 "<output file>\n\n"); 201 "lbatest <drive letter|number> <number of sectors> <outfile> [buffer size]\n\n" 202 "where:\n" 203 "drive letter drive letter of logical drive to read from\n" 204 "drive number 1-based physical disk number to read from\n" 205 "number of sectors number of sectors to read (e.g. 1024)\n" 206 "outfile path and filename of output file\n" 207 "buffer size buffer size in number of sectors (512 byte)\n" 208 " (default is %d sectors)\n", 209 SECTORS_PER_READ); 191 210 } 192 211
Note:
See TracChangeset
for help on using the changeset viewer.