Consistently use SI-compliant notation for file sizes (B/KiB/MiB/GiB/TiB) where appropriate. (#855)

This commit is contained in:
Daniel Markstedt 2022-09-25 14:37:36 -07:00 committed by GitHub
parent e513af694b
commit 12b61ada84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 28 deletions

View File

@ -99,7 +99,7 @@ Launch RaSCSI with an Apple hard drive image as ID 0 and a CD-ROM as ID 2
Launch RaSCSI with a removable SCSI drive image as ID 0 and the raw device file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter as ID 6:
rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport
To create an empty, 100MB HD image, use the following command:
To create an empty, 100MiB HD image, use the following command:
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800
In case the fallocate command is available a much faster alternative to the dd command is:

View File

@ -128,7 +128,7 @@ EXAMPLES
as ID 6:
rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport
To create an empty, 100MB HD image, use the following command:
To create an empty, 100MiB HD image, use the following command:
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800
In case the fallocate command is available a much faster alternative to

View File

@ -567,7 +567,7 @@ function showMacproxyStatus() {
}
# Creates a drive image file with specific parameters
function createDrive600MB() {
function createDrive600M() {
createDrive 600 "HD600"
}
@ -575,7 +575,7 @@ function createDrive600MB() {
function createDriveCustom() {
driveSize=-1
until [ $driveSize -ge "10" ] && [ $driveSize -le "4000" ]; do
echo "What drive size would you like (in MB) (10-4000)"
echo "What drive size would you like (in MiB) (10-4000)"
read driveSize
echo "How would you like to name that drive?"
@ -666,10 +666,10 @@ function createDrive() {
driveSize=$1
driveName=$2
mkdir -p "$VIRTUAL_DRIVER_PATH"
drivePath="${VIRTUAL_DRIVER_PATH}/${driveSize}MB.hda"
drivePath="${VIRTUAL_DRIVER_PATH}/${driveSize}M.hda"
if [ ! -f "$drivePath" ]; then
echo "Creating a ${driveSize}MB Drive"
echo "Creating a ${driveSize}MiB Drive"
truncate --size "${driveSize}m" "$drivePath"
echo "Formatting drive with HFS"
@ -1190,9 +1190,9 @@ function runChoice() {
echo "Installing / Updating RaSCSI OLED Screen - Complete!"
;;
4)
echo "Creating an HFS formatted 600MB drive image with LIDO driver"
createDrive600MB
echo "Creating an HFS formatted 600MB drive image with LIDO driver - Complete!"
echo "Creating an HFS formatted 600 MiB drive image with LIDO driver"
createDrive600M
echo "Creating an HFS formatted 600 MiB drive image with LIDO driver - Complete!"
;;
5)
echo "Creating an HFS formatted drive image with LIDO driver"
@ -1316,8 +1316,8 @@ function showMenu() {
echo " 3) install or update RaSCSI OLED Screen (requires hardware)"
echo "CREATE HFS FORMATTED (MAC) IMAGE WITH LIDO DRIVERS"
echo "** For the Mac Plus, it's better to create an image through the Web Interface **"
echo " 4) 600MB drive (suggested size)"
echo " 5) custom drive size (up to 4000MB)"
echo " 4) 600 MiB drive (suggested size)"
echo " 5) custom drive size (up to 4000 MiB)"
echo "NETWORK BRIDGE ASSISTANT"
echo " 6) configure network bridge for Ethernet (DHCP)"
echo " 7) configure network bridge for WiFi (static IP + NAT)"

View File

@ -10,7 +10,7 @@
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
@ -54,7 +54,7 @@
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
@ -100,7 +100,7 @@
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
@ -135,7 +135,7 @@
{% endfor %}
</tbody>
</table>
<p><small>{{ _("%(disk_space)s MB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<p><a href="/">{{ _("Cancel") }}</a></p>
{% endblock content %}

View File

@ -231,7 +231,7 @@
<td style="text-align:center">
<form action="/files/download" method="post">
<input name="file" type="hidden" value="{{ base_dir }}/{{ file['name'] }}">
<input type="submit" value="{{ file['size_mb'] }} {{ _("MB") }} &#8595;">
<input type="submit" value="{{ file['size_mb'] }} {{ _("MiB") }} &#8595;">
</form>
</td>
<td>
@ -301,7 +301,7 @@
{% endfor %}
</tbody>
</table>
<p><small>{{ _("%(disk_space)s MB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<hr/>
<details>
@ -381,7 +381,7 @@
</summary>
<ul>
<li>{{ _("Files are uploaded to <tt>%(directory)s</tt>.", directory=base_dir) }}</li>
<li>{{ _("The largest file size accepted in this form is %(max_file_size)s MB. Use other file transfer means for larger files.", max_file_size=max_file_size) }}</li>
<li>{{ _("The largest file size accepted in this form is %(max_file_size)s MiB. Use other file transfer means for larger files.", max_file_size=max_file_size) }}</li>
<li>{{ _("File uploads will progress only if you stay on this page. If you navigate away before the transfer is completed, you will end up with an incomplete file.") }}</li>
</ul>
</details>
@ -399,12 +399,12 @@
chunking: true,
forceChunking: true,
url: '/files/upload',
maxFilesize: {{ max_file_size }}, // MB
maxFilesize: {{ max_file_size }}, // MiB
chunkSize: 1000000, // bytes
dictDefaultMessage: "{{ _("Drop files here to upload") }}",
dictFallbackMessage: "{{ _("Your browser does not support drag'n'drop file uploads.") }}",
dictFallbackText: "{{ _("Please use the fallback form below to upload your files like in the olden days.") }}",
dictFileTooBig: "{{ _("File is too big: {{filesize}}MB. Max filesize: {{maxFilesize}}MB.") }}",
dictFileTooBig: "{{ _("File is too big: {{filesize}}MiB. Max filesize: {{maxFilesize}}MiB.") }}",
dictInvalidFileType: "{{ _("You can't upload files of this type.") }}",
dictResponseError: "{{ _("Server responded with code: {{statusCode}}") }}",
dictCancelUpload:" {{ _("Cancel upload") }}",
@ -413,10 +413,10 @@
dictRemoveFile: "{{ _("Remove file") }}",
dictMaxFilesExceeded: "{{ _("You can not upload any more files.") }}",
dictFileSizeUnits: {
tb: "{{ _("TB") }}",
gb: "{{ _("GB") }}",
mb: "{{ _("MB") }}",
kb: "{{ _("KB") }}",
tb: "{{ _("TiB") }}",
gb: "{{ _("GiB") }}",
mb: "{{ _("MiB") }}",
kb: "{{ _("KiB") }}",
b: "{{ _("B") }}"
}
}
@ -565,7 +565,7 @@
{% endfor %}
</select>
<label for="size">{{ _("Size:") }}</label>
<input name="size" type="number" placeholder="{{ _("MB") }}" min="1" max="262144" required>
<input name="size" type="number" placeholder="{{ _("MiB") }}" min="1" max="262144" required>
<input type="submit" value="{{ _("Create") }}">
</form>
</td>

View File

@ -908,15 +908,15 @@ int main(int argc, char* argv[])
(buffer[2] << 8) | buffer[3];
bnum++;
printf("Number of blocks : %d Blocks\n", (int)bnum);
printf("Block length : %d Bytes\n", (int)bsiz);
printf("Unit Capacity : %d MBytes %d Bytes\n",
printf("Block length : %d B\n", (int)bsiz);
printf("Unit Capacity : %d MiB %d B\n",
(int)(bsiz * bnum / 1024 / 1024),
(int)(bsiz * bnum));
// Get the restore file size
if (restore) {
size = fio.GetFileSize();
printf("Restore file size : %d bytes", (int)size);
printf("Restore file size : %d B", (int)size);
if (size > (off_t)(bsiz * bnum)) {
printf("(WARNING : File size is larger than disk size)");
} else if (size < (off_t)(bsiz * bnum)) {