View Single Post
Old 24 October 2003, 11:29   #5
Registered User
thomas's Avatar
Join Date: Jan 2002
Location: Germany
Posts: 5,681
Ninja ? This was nothing. Normal doing. Every-day usage.

With the List command you list the directory. Each directory entry gives one line. The lformat string gives the line format. The %-tokens are replaced by the corresponding values. The formatting is done like that of the printf() function of the C language. Special characters must be escaped in BCPL style (the BCPL escape character is * as opposed to \ in C).

These are the tokens:

%s = old style, do not use. Each %s gives either path or file name (alternating). If more than one %s is there, it begins with path. If the number is unequal, the last %s is file name. (e.g. "%s%s %s" gives "path/file file")

well-known tokens:

%p = Path (as specified in command line)
%n = File name
%m = File name without extension
%c = File comment
%l = File size (memory hook: l = length)
%d = Date
%t = Time
%a = Protection bits


%e = File name extension
%f = Full path

these must be new for OS3.9, at least I did not know them:

%b = Block number ?
%k = Key number ?
%g = Group (for multi user file systems)
%u = User (for multi user file systems)
%v = Group+User protection bits

Some examples for escaped special characters:

*" = Quotation mark
** = Asterisk
*n = New line
*r = Carriage return
*t = Tab
*e = Esc
*e[ = CSI (Command Sequence Intruducer)

The default lformat is "%-30n %7l %a %d %t" or, if a comment is present: lformat="%-30n %7l %a %d %t*n: %c"

This is well documented in the DOS manual which is available in HTML format on the OS3.9 CD.
thomas is offline  
Page generated in 0.03981 seconds with 10 queries