Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

FILESIZE AmigaDOS
Format: FILESIZE [{<directory< | <file> | <pattern> | <device>}] [FROM <filename>] [ALL] [REPORT] [FORMAT <string>]
Template: FILES/A, FROM/K, ALL/S, REPORT/S, FORMAT/K
Purpose: To collect information on the size of files stored on a disk.
Path: C:FILESIZE
FILESIZE will collect information on files stored on a disk, adding up the number of bytes and blocks used, counting the number of files found. If you specify a <directory>, <file> or <pattern> argument, FILESIZE will add the file data for the specified directory, all directories or files that match the pattern, or the specified file or device, respectively. Instead of providing the names on the command line, you can also specify the name of a file from which the names should be read.

Options:
FILES A list of files, directories or wildcard patterns which should be examined. You either need to provide this parameter or a file name with the FROM option.
FROM The name of a text file which contains the names of files, directories or wildcard patterns which should be examined. You either need to provide this parameter or a list of names with the FILES option.
ALL Also examines the files in all directories and subdirectories.
REPORT Print progress reports as directory contents are scanned. Each such report will be prefixed by the name of the directory and final total number of files, blocks, bytes will be prefixed by "TOTAL".
FORMAT Defines a string to specially format FILESIZE output. Supported format specifiers are:
%b Prints the number of blocks used
%B Prints the number of blocks used, but uses the current locale formatting rules
%l Prints the number of bytes used
%L Prints the number of bytes used, but uses the current locale formatting rules
%S Prints the number of bytes used, rounded to Kilobytes, Megabytes, Gigabytes, etc
%f Prints the number of files found, but uses the current locale formatting rules
%F Prints the number of files found, but uses the current locale formatting rules
%N Prints the full name of the directory the information has been gathered for, or the label "TOTAL" for the grand total of all data gathered
%% Prints the percent character
The escape sequences '*E' and '*N' are expanded, too.
If you do not specify a special format, FILESIZE will use "%F files, %L bytes, %B blocks" and, if the "REPORT" option is used, "%N: %F files, %L bytes, %B blocks".
Output formatting follows 'C' conventions, e.g. "%10l" will print at least 10 digits for the number of bytes used, right justified.

Example 1:

3.OS4:> FILESIZE C: FORMAT "%l"
1958872
Examines the contents of the C: directory, adding up the sizes of all files found, then prints just the number of bytes used.

Example 2:

3.OS4:> FILESIZE C: FORMAT "%s"
1912K
Same as above, but prints the size as a rounded number. Note that a Kilobyte is worth 1024 bytes (and not 1000).

Example 3:

3.OS4:> FILESIZE LIBS: ALL FORMAT "%F files found"
178 files found
Displays how many files are stored in the LIBS: directory.

Example 4:

3.OS4:> FILESIZE SYS:#? ALL REPORT
SYS:C: 71 files, 354,230 bytes, 722 blocks
SYS:Classes: 49 files, 786,244 bytes, 1,560 blocks
SYS:Devs: 278 files, 1,734,474 bytes, 3,502 blocks
SYS:Expansion: 0 files, 0 bytes, 0 blocks
SYS:Fonts: 62 files, 777,024 bytes, 1,554 blocks
SYS:L: 10 files, 106,488 bytes, 215 blocks
SYS:Libs: 73 files, 2,147,780 bytes, 4,232 blocks
SYS:Prefs: 585 files, 14,115,024 bytes, 27,836 blocks
SYS:Rexxc: 10 files, 4,628 bytes, 13 blocks
SYS:S: 19 files, 14,100 bytes, 38 blocks
SYS:Storage: 292 files, 1,408,042 bytes, 2,868 blocks
SYS:System: 16 files, 154,916 bytes, 310 blocks
SYS:T: 0 files, 0 bytes, 0 blocks
SYS:Tools: 49 files, 686,316 bytes, 1,364 blocks
SYS:Utilities: 88 files, 2,267,465 bytes, 4,470 blocks
SYS:WBStartup: 11 files, 257,923 bytes, 509 blocks
SYS:Locale: 460 files, 2,581,114 bytes, 5,295 blocks
TOTAL: 2,082 files, 27,422,060 bytes, 54,545 blocks
Prints report on the individual directories found on SYS.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.