<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from ../vice.texi on 7 January 2006 -->
<TITLE>VICE Manual - 10 c1541</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_9.html">previous</A>, <A HREF="vice_11.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC147" HREF="vice_toc.html#TOC147">10 c1541</A></H1>
<P>
VICE is provided with a complete stand-alone disk image maintenance
utility, called <CODE>c1541</CODE>.
</P>
<P>
You can either invoke it from the command
line or from within one of the VICE emulators, using the "Run c1541"
command which will open a new <CODE>xterm</CODE> window with a running
<CODE>c1541</CODE> in it.
</P>
<P>
The syntax is:
</P>
<PRE>
c1541 [IMAGE1 [IMAGE2]] [COMMAND1 COMMAND2 ... COMMANDN]
</PRE>
<P>
<CODE>IMAGE1</CODE> and <CODE>IMAGE2</CODE> are disk image names that can be
attached before <CODE>c1541</CODE> starts. <CODE>c1541</CODE> can handle up to
two disk images at the same time by using two virtual built-in drives,
numbered <CODE>8</CODE> and <CODE>9</CODE>; <CODE>IMAGE1</CODE> (if present) is always
attached to drive <CODE>8</CODE>, while <CODE>IMAGE2</CODE> is attached to drive
<CODE>9</CODE>.
</P>
<P>
<CODE>COMMAND</CODE>s specified on the command-line all begin with the minus
sign (<CODE>-</CODE>); if present, <CODE>c1541</CODE> executes them in the same
order as they are on the command line and returns a zero error code if
they were successful. If any of the <CODE>COMMAND</CODE>s fails, <CODE>c1541</CODE>
stops and returns a nonzero error code.
</P>
<P>
If no <CODE>COMMAND</CODE>s are specified at all, <CODE>c1541</CODE> enters
interactive mode, where you can type commands manually. Commands in
interactive mode are the same as commands in batch mode, but do not
require a leading <CODE>-</CODE>. As with the monitor, file name completion
and command line editing with history are provided via GNU
<CODE>readline</CODE>. Use the command <SAMP>`quit'</SAMP> or press <KBD>C-d</KBD> to
exit.
</P>
<H2><A NAME="SEC148" HREF="vice_toc.html#TOC148">10.1 Specifying files in c1541</A></H2>
<P>
When accessing CBM DOS files (i.e. files that reside on disk images),
c1541 uses a special syntax that lets you access files on both drive 8
and 9. If you prepend the file name with <CODE>@8:</CODE> or <CODE>@9:</CODE>, you
will specified that file is to be found or created on drive 8 and 9,
respectively.
</P>
<P>
For instance,
</P>
<PRE>
@8:somefile
</PRE>
<P>
will name file named <CODE>somefile</CODE> on unit 8, while
</P>
<PRE>
@9:somefile
</PRE>
<P>
will name file named <CODE>somefile</CODE> on unit 9.
</P>
<H2><A NAME="SEC149" HREF="vice_toc.html#TOC149">10.2 Using quotes and backslashes</A></H2>
<P>
You can use quotes (<CODE>"</CODE>) in a command to embed spaces into file
names. For instance,
</P>
<PRE>
read some file
</PRE>
<P>
will read file <CODE>some</CODE> from the disk image and write it into the
file system as <CODE>file</CODE>, while
</P>
<PRE>
read "some file"
</PRE>
<P>
will copy <CODE>some file</CODE> into the file system, with the name
<CODE>some file</CODE>.
</P>
<P>
The backslash character (<CODE>\</CODE>) has a special meaning too: it lets
you literally insert the following character no matter what it is. For
example,
</P>
<PRE>
read some\ file
</PRE>
<P>
will copy file <CODE>some file</CODE> into the file system, while
</P>
<PRE>
read some\ file this\"file
</PRE>
<P>
will copy <CODE>some file</CODE> into the file system with name
<CODE>this"file</CODE> (with an embedded quote).
</P>
<H2><A NAME="SEC150" HREF="vice_toc.html#TOC150">10.3 c1541 commands and options</A></H2>
<P>
This is a list of the <CODE>c1541</CODE> commands. They are shown in their
interactive form, without the leading <CODE>-</CODE>.
Square brackets [] indicate an optional part, and "<COMMAND>" translates
to a disk command according to CBM DOS, like "i0" for example.
</P>
<DL COMPACT>
<DT><CODE>[<command>]</CODE>
<DD>
Execute specified CBM DOS command and print the current status of the
drive. If no <CODE>command</CODE> is specified, just print the status.
<DT><CODE>? [<command>]</CODE>
<DD>
Explain specified command. If no command is specified, list available
ones.
<DT><CODE>attach <diskimage> [<unit>]</CODE>
<DD>
Attach <CODE>diskimage</CODE> to <CODE>unit</CODE> (default unit is 8).
<DT><CODE>block <track> <sector> <disp> [<drive>]</CODE>
<DD>
Show specified disk block in hex form.
<DT><CODE>copy <source1> [<source2> ... <sourceN>] <destination></CODE>
<DD>
Copy <CODE>source1</CODE> ... <CODE>sourceN</CODE> into destination. If N > 1,
<CODE>destination</CODE> must be a simple drive specifier (<CODE>@n:</CODE>).
<DT><CODE>delete <file1> [<file2> ... <fileN>]</CODE>
<DD>
Delete the specified files.
<DT><CODE>exit</CODE>
<DD>
Exit (same as <CODE>quit</CODE>).
<DT><CODE>extract</CODE>
<DD>
Extract all the files to the file system.
<DT><CODE>format <diskname,id> [<type> <imagename>] [<unit>]</CODE>
<DD>
If <CODE>unit</CODE> is specified, format the disk in unit <CODE>unit</CODE>. If
<CODE>type</CODE> and <CODE>imagename</CODE> are specified, create a new image named
<CODE>imagename</CODE>, attach it to unit 8 and format it. <CODE>type</CODE> is a
disk image type, and must be either <CODE>x64</CODE>, <CODE>d64</CODE> (both VC1541/2031),
<CODE>g64</CODE> (VC1541/2031 but in GCR coding), <CODE>d71</CODE> (VC1571), <CODE>d81</CODE>
(VC1581), <CODE>d80</CODE> (CBM8050) or <CODE>d82</CODE> (CBM8250/1001).
Otherwise, format the disk in the current unit, if any.
<DT><CODE>gcrformat <diskname,id> <imagename></CODE>
<DD>
Create and format a G64 disk image named <CODE>imagename</CODE>.
<DT><CODE>help [<command>]</CODE>
<DD>
Explain specified command. If no command is specified, list available
ones.
<DT><CODE>info [<unit>]</CODE>
<DD>
Display information about unit <CODE>unit</CODE> (if unspecified, use the current
one).
<DT><CODE>list [<pattern>]</CODE>
<DD>
List files matching <CODE>pattern</CODE> (default is all files).
<DT><CODE>quit</CODE>
<DD>
Exit (same as <CODE>exit</CODE>).
<DT><CODE>read <source> [<destination>]</CODE>
<DD>
Read <CODE>source</CODE> from the disk image and copy it into <CODE>destination</CODE> in
the file system. If <CODE>destination</CODE> is not specified, copy it into a
file with the same name as <CODE>source</CODE>.",
<DT><CODE>rename <oldname> <newname></CODE>
<DD>
Rename <CODE>oldname</CODE> into <CODE>newname</CODE>. The files must be on the
same drive.
<DT><CODE>tape <t64name> [<file1> ... <fileN>]</CODE>
<DD>
Extract files from a T64 image.
<DT><CODE>unit <number></CODE>
<DD>
Make unit <CODE>number</CODE> the current unit.
<DT><CODE>unlynx <lynxname> [<unit>]</CODE>
<DD>
Extract the specified Lynx image file into the specified unit (default
is the current unit).
<DT><CODE>validate [<unit>]</CODE>
<DD>
Validate the disk in unit <CODE>unit</CODE>. If <CODE>unit</CODE> is not specified,
validate the disk in the current unit.
<DT><CODE>write <source> [<destination>]</CODE>
<DD>
Write <CODE>source</CODE> from the file system into <CODE>destination</CODE> on a
disk image.
<DT><CODE>zcreate <x64name> <zipname> [<label,id>]</CODE>
<DD>
Create an X64 disk image out of a set of four Zipcoded files named
<CODE>1!zipname</CODE>, <CODE>2!zipname</CODE>, <CODE>3!zipname</CODE> and
<CODE>4!zipname</CODE>.
</DL>
<H2><A NAME="SEC151" HREF="vice_toc.html#TOC151">10.4 Executing shell commands</A></H2>
<P>
If you want to execute a shell command from withing <CODE>c1541</CODE>, just
prepend it with an exclamation mark (<CODE>!</CODE>). For example,
</P>
<PRE>
!ls -la
</PRE>
<P>
will execute the command <CODE>ls -la</CODE>, which will show you all the
files in the current directory.
</P>
<P><HR><P>
Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_9.html">previous</A>, <A HREF="vice_11.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
</BODY>
</HTML>