Star List

This program was designed to list the contents of image files and Commodore archive files onto the screen or into a text file. Star List is an external utility of The Star Commander but is also distributed separately.

1. Usage

STARLIST <filename> [-|/<options>] [<listname> [<formatname>]]

<filename>:

Enter the path, the name and the extension of files to be listed. You can use wildcards to list multiple files and you can use long filenames, too.

<listname>:

Type the path, the name and the extension of the list file here. If the file already exists, the list will be appended to its contents. If you omit this parameter then the list is dumped onto the screen.

<formatname>:

Specify the path, the name and the extension of the file that contains the format specification. When omitted, the contents of image and archive files are listed in a format similar to the Commodore disk directory list, using the lowercase/uppercase character set. If you specify a format file, a list file must also be specified – the output may not go onto the screen.

<options>:

2. Format specification

The format specification file, similarly to the format parameter of the "printf" instruction in the C language, may contain normal characters, special characters and field specifiers. Additionally, you can use conditional blocks. Carriage returns and line feeds are completely ignored throughout the file so you may wrap your lines anywhere.

Special characters stand for and are replaced by a normal character. They have the following syntax:

\<specchar>

Note that you have to specify "\\" to display the "\" character.

<specchar>:

Field specifiers are replaced by a string taken from the data related to the current container file – image or archive file – or the current Commodore file file inside it. When scanning field specifiers, invalid characters – ones not listed below – are ignored silently. Field specifiers have the following syntax:

%[<width>][<flags>]<type>

Note that you have to specify "%%" or "\$25" to display the "%" character.

<width>:

With these, you can first cut the strings into the width needed and then pad them with spaces. Don't use numbers, indicated by N, higher than 255. Use width specifiers in the order they're grouped below – which is not the same as the order they're applied – and don't use any from the same group twice, otherwise the result is undefined. The first group of width specifiers is the following:

The second group of width specifiers is the following:

<flags>:

<type>:

Unlike other parts of the format specifier, most types are case-sensitive. The lowercase version, usually, stands for the default or short form; the uppercase version for the long form. Types related to containers are the following:

Types related to Commodore files inside the containers are the following:

Data inside conditional blocks is used for formatting and the resulting text is output only if a condition is met. You may nest conditional blocks into each other, thus creating an "and" relation. For an "or" relation, you have to create two blocks, with different conditions but the same contents. The syntax of conditional blocks is the following:

%?<condition>...%?!

Note that the symbol "%?!" ends the innermost conditional block.

<condition>:

Examples:

  1. Display an output identical to the Commodore disk directory list, using the lowercase/uppercase character set:

    %?^\r\nListing %D%P%F%E\r\n
    \r\n
    0 "%-16gl" %gI\r\n%?!
    %-5s%-18gqn%1c%gt%w\r\n
    %?$%b blocks free.\r\n%?!

  2. Display an output almost identical to the unformatted output, as if no format specification file were given on the command line:

    %?^\r\nListing: %D%P%F%E ("%gL")\r\n
    Blocks Name Type\r\n
    ------ ------------------ -----\r\n%?!
    %6s %-18gqn %1c%gt%w\r\n
    %?$------ ------------------ -----\r\n
    %6*s %4*n files\r\n%?!

  3. A simple way of including directory lists in HTML, using Netscape-style hexadecimal codes for invalid characters and appending the number of files having been listed:

    %?h<HTML>\r\n
    <TITLE>Directory list</TITLE>\r\n
    <BODY>\r\n%?!
    %?^Directory list of %D%P%F%E<P>\r\n%?!
    <A HREF="file:%D%P%F%E">%ghn</A><BR>\r\n
    %?$<P>\r\n%?!
    %?fListed %*f files.\r\n
    </BODY>\r\n
    </HTML>\r\n%?!

  4. A simple way of creating a CSV file with a header that you can easily import into a database:

    %?hidrive,ipath,iname,iext,fname,fblk,ftype,fsplat,fprot\r\n%?!
    %/1D,"%/R","%F","%/+2E","%gn",%s,%/1ut,%C,%W\r\n

  5. Another format that can be imported into a database of the same structure as the previous example, only there's no header and the fields are separated with Tabs instead of commas:

    %/1D\t%/R\t%F\t%/+2E\t%gn\t%s\t%/1ut\t%C\t%W\r\n

3. Error messages

4. Copyright and legal issues

This program is freeware. You may use it as long as you wish and you may give it to any individual, provided that it's in the original, unmodified archive. It is highly recommended that you download distribution packages from the homepage or other official distribution sites. If you get a package from somewhere else then make sure that the package has the author's authentic verification stamped on it.

The source of this program is distributed under a license that is similar to the GNU Public License but is more restrictive, for the protection of the users and the author. You may distribute only those modified versions or derived softwares that satisfy all restrictions in the license. When you distribute this program, modified versions of it or softwares derived from it, you may not ask for money above the normal fee of the distribution media itself. Furthermore, you may not publish this program or its source on floppy disks, CD-ROM's, FTP sites, WWW pages or any other distribution media, include it in a software compilation or bundle it with other software or hardware without prior permission of the author.

Note that public distribution of the beta releases of this program is prohibited. The only place where you can find them is the homepage.

This program is provided "as is", without a warranty of any kind. You are using it at your own risk. The author is not liable for any damage or data loss caused by the software.

5. The author

If you're interested in some similarly useful utilities then contact me at the E-mail address sta.ANTI@SPAM.c64.org or visit my homepage at http://sta.c64.org.

Joe Forster/STA
11th January, 2010

(This page best viewed with any browser)