par.html
来自「进行Palm开发时」· HTML 代码 · 共 266 行
HTML
266 行
<!-- manual page source format generated by PolyglotMan v3.0.7, --><!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z --><HTML><HEAD><TITLE>Par(1) Manual Page</TITLE></HEAD><BODY bgcolor=white><A HREF="#toc">Table of Contents</A><P> <H2><A NAME="sect0" HREF="#toc0">Name </A></H2>par - Palm database archiver, version 0.5. <H2><A NAME="sect1" HREF="#toc1">Synopsis </A></H2><B>par t</B> <I>dbfile</I> <P><B>par h</B> <I>dbfile</I> <P><B>par x</B> <I>dbfile</I> <B>[</B><I>ioptions</I><B>]</B> <B>[</B><I>records..</I><B>]</B> <P><B>par c</B> <B>[</B><I>hoptions</I><B>]</B> <I>dbfile name type cid</I> <B>[</B><I>ioptions</I><B>]</B> <B>[</B><I>files..</I><B>]</B> <P><B>par u</B> <B>[</B><I>hoptions</I><B>]</B> <I>dbfile</I> <B>[</B><I>ioptions</I><B>]</B> <B>[</B><I>updates..</I><B>]</B> <P><B>par a</B> <B>[</B><I>hoptions</I><B>]</B> <I>dbfile</I> <B>[</B><I>ioptions</I><B>]</B> <B>[</B><I>files..</I><B>]</B> <P><B>par d</B> <B>[</B><I>hoptions</I><B>]</B> <I>dbfile</I> <B>[</B><I>doptions</I><B>]</B> <B>[</B><I>records..</I><B>]</B> <P><B>par V</B> <H2><A NAME="sect2" HREF="#toc2">Description </A></H2>The <B>par</B> utility creates and manipulates PalmOS database <B>(.pdb)</B> and resource <B>(.prc)</B> files. The first argument determines the mode of operation, as follows: <DL><DT><B>t</B> </DT><DD>List contents. For regular databases a list of records is generated, each line showing the record attributes, category, record size, and an ascii dump of the first few bytes of the record. For resource databases, a list of resources is generated, each line showing resource type, hex id, size, and ascii dump of the first few bytes of the resource. </DD><DT><B>h</B> </DT><DD>List header information. A report of the database header is generated, showing the database name (this is the name that would be visible on a device), the database type, creator id, attributes, version, creation time, last modification time, last backup time, mod number, nrecords (or resources), and the size of the application info block in the database. </DD><DT><B>x</B> </DT><DD>Extract. The extract mode can extract all or just specific records from a database. With no further arguments, all records will be extracted from the database. If further arguments are provided, these should specify the <I>index</I> of the record to extract for regular databases, and the <I>type</I> and <I>id</I> of the desired resource for resource databases. By default, individual records will be saved as files with the name <I><index>.pdr</I>, where <I><index></I> is the index of the record in the database, individual resources will be saved as files with the name <I><type><id>.bin</I>, where <I><type></I> is the 4 character type of the resource, and <id> is the resource id in 4 digit hexadecimal. A preferred <I>filename</I> for a saved item can be specified for each record using the <B>-f</B> option to the record or resource specification. </DD><DT><B>c</B> </DT><DD>Create a new database. The create mode creates a new database file, with the database <I>name</I>, <I>type</I>, and <I>creator</I> id specified as (required) arguments. If no further arguments are specified, the resulting database will contain no records, but will have a valid database header. If further arguments are specified, they should specify files to be appended to the database as records or resources (see the <B>-a</B> mode description). </DD><DT><B>u</B> </DT><DD>Touch the header or record attributes. In touch mode, changes to the database header can be specified. By default, the last modification time will be updated to the current time, but further changes can be specified using the header options. See <B>HEADER OPTIONS</B> section. In addition, attribute information for particular records can be specified. For regular databases, the new record <I>category</I> and <I>record</I> attributes may be specified, using the <B>-c</B> and <B>-a</B> options. The records to touch are specified by <I>index</I>. For resource databases, the new resource <I>type</I> and <I>id</I> may be specified using the <B>-T</B> option. The resources to touch are specified by <I><type></I> and <I><id></I>. </DD><DT><B>a</B> </DT><DD>Append records or resources. In append mode, records or resources will be added to the database. For regular databases, the target record <I>category</I> and <I>record</I> attributes may be specified, using the <B>-c</B> and <B>-a</B> options before the source filename. For resource databases, the target resource <I>type</I> and <I>id</I> may be specified using the <B>-T</B> option before the source filename. If the <B>-T</B> option is not specified, the source filename is assumed to specify the <I>type</I> and <I>id</I> in the <I><type><index></I> fashion described for the <B>x</B> mode. In addition to individual records and resources, <B>par</B> can append whole databases, in effect merging the records or resources from one database into another. Databases may be specified as append items explicitly using the <B>-p</B> argument option, or implicitly by using a <I>.pdb</I> extension for record databases, and <I>.prc</I> extension for resource databases. </DD><DT><B>d</B> </DT><DD>Delete. In delete mode, records or resources are removed from the database. Records are specified by <I>index</I>, resources are specified by <I>type</I> and <I>id</I>. </DD><DT><B>V</B> </DT><DD>Version. Print the version number. </DD><DT><B>r</B> </DT><DD>Create resource. <B>r</B> is an convenience alias for <B>c -a</B> <B>resource</B>. See <B>HEADER OPTIONS</B> section. </DD><DT><B>l</B> </DT><DD><B>l</B> is an alias for <B>t</B>. </DD><DT><B>i</B> </DT><DD><B>i</B> is an alias for <B>h</B>. </DD><DT><B>-</B><I>mode</I> </DT><DD>All modes may be prefixed with <B>-</B> if that makes you feel better. </DD></DL> <H2><A NAME="sect3" HREF="#toc3">Header Options </A></H2>The <B>a</B>, <B>c</B>, <B>d</B>, <B>u</B> modes accept <I>hoptions</I> which update the database information as follows: <DL><DT><B>-n </B><I>name </I> </DT><DD>Database name. This is the name of the database that will be visible on the device. Note that this is entirely independent from the <I>dbfile</I>, although some utilities will imply the latter from the former. </DD><DT><B>-T </B><I>type </I> </DT><DD>The four character database type. For example, an application resource database is of type <I>'appl'</I>. The address book database is of type <I>'DATA'</I>. </DD><DT><B>-I </B><I>cid </I> </DT><DD>The four character creator identifier. This specifies which application owns the database. </DD><DT><B>-a </B><I>attributes </I> </DT><DD>Database attributes. These may be specified as a hex number, or symbolically using the keywords <B>resource</B>, <B>readonly</B>, <B>dirty</B>, <B>backup</B>, <B>newer</B>, <B>reset</B>, <B>copyprevent</B>, <B>stream</B>, <B>hidden</B>, <B>launchable</B>, <B>recyclable</B>, <B>bundle</B>, or any bit-ORed combination of names or hex numbers. For new databases, the attributes default to 0x0 (none set). </DD><DT><B>-v </B><I>version </I> </DT><DD>The database version. For new databases, this defaults to 1. </DD><DT><B>-C </B><I>creation_time </I> </DT><DD>The time the database was created. Times should be specified using the format <I>[[CC]YY]MMDDHHMM</I>, or using the special keywords <B>now</B>, or <B>never</B>. The former is the current time, that latter is the beginning of PalmOS time (90401010000). For new databases, this defaults to <B>now</B>. </DD><DT><B>-m </B><I>last_modification_time </I> </DT><DD>The time the database was created. For new databases, this defaults to <B>now</B>. </DD><DT><B>-b </B><I>last_backup_time </I> </DT><DD>The time the database was last backed up. For new databases, this defaults to <B>never</B>. </DD></DL> <H2><A NAME="sect4" HREF="#toc4">Info Options </A></H2>The <B>x</B>, <B>c</B>, <B>u</B>, and <B>a</B> modes accept <I>ioptions</I>, and the <B>d</B> mode accepts <I>doptions</I>, which operate on the app and sort info in the database: <DL><DT><B>-A </B><I>filename </I> </DT><DD>AppInfo filename. In <B>x</B> mode, specifies that the database AppInfo should be saved to <I>filename.</I> In <B>c</B>,<B>u</B>, and <B>a</B> modes, specifies that the database AppInfo should be set from <I>filename.</I> </DD><DT><B>-S </B><I>filename </I> </DT><DD>SortInfo filename. In <B>x</B> mode, specifies that the database SortInfo should be saved to <I>filename.</I> In <B>c</B>,<B>u</B>, and <B>a</B> modes, specifies that the database SortInfo should be set from <I>filename.</I> </DD><DT><B>-A</B> </DT><DD>Delete AppInfo. In <B>d</B> mode, specifies that the database AppInfo should be deleted from the database. </DD><DT><B>-S</B> </DT><DD>Delete SortInfo. In <B>d</B> mode, specifies that the database SortInfo should be deleted from the database. </DD></DL> <H2><A NAME="sect5" HREF="#toc5">Examples </A></H2>The following example prints the header information for the database 'foo.pdb'. <P><B>par h foo.pdb</B> <P>The following extracts all records from 'foo.pdb'. <P><B>par x foo.pdb</B> <P>The following extracts the application icon resource from 'app.prc' and saves it in the file 'icon.Tbmp'. Note the use of decimal specification for the resource id. The id may be specified in hex using by using the '0x' prefix. <P><B>par x app.prc -f icon.Tbmp tAIB 1000</B> <P>The following creates a new application resource database from all the the files with a '.bin' extension in the current directory. The database will have creator id of 'djwP' and will have the backup bit set. <P><B>par c -a "resource|backup" app.prc myapp appl djwP *.bin</B> <P>If you use the author's technique for creating multi-segment library prcs with CodeWarrior, the following example will be useful. This example uses the touch mode to change the database type to 'libr', and to change the attribute type of the primary code resource from type = 'code', id = '1' (as used in an application) to type = 'libr', id = '0' (as used in a library). <P><B>par u -T libr mylib.prc -T libr 0 code 1</B> <P>The following example merges the resources from two different resource databases, <I>code.prc</I>, and <I>resource.prc</I> into a single target application database, <I>myapp.prc</I>. This technique is useful for managing code and non-code elements of an application, using the individual resource databases as libraries. <P><B>par r myapp.prc myapp appl djwP code.prc resource.prc</B> <P>By default, <B>par</B> saves extracted resources using the form <I><type><id>.bin</I>, where <I><type></I> is the 4 character type of the resource, and <id> is the resource id in 4 digit hexadecimal. When appending resources to a new or existing resource database, <B>par</B> will attempt to decode the resource and id of the resource being appended from the resource filename using this same naming scheme, or you can explicitly specify the resource and id using the <I>-T</I> syntax. Here are two invocations of <B>par</B> that do exactly the same thing: create a new resource database with one resource which has type = NFNT and id = 256 (0x0100 hexadecimal): <P><B>par c -a "resource" font.prc Font FONT djwF NFNT0100.bin</B> <P><B>par r font.prc Font FONT djwF -T NFNT 256 myfont</B> <P>The following example creates a stream database that can be accessed using the PalmOS FileStream API. The stream will contain the contents of the file 'WarAndPeace.txt': <P><B>par c -a "stream" book.pdb Book DATA djwS WarAndPeace.txt</B> <P>In the following example, 'book.pdb' is a stream database. This example extracts the stream from that database and stores the result in the output file 'Book.txt': <P><B>par x book.pdb Book.txt</B> <H2><A NAME="sect6" HREF="#toc6">Author </A></H2><B>par</B> was written by David Williams, djw@djw.org <P><HR><P><A NAME="toc"><B>Table of Contents</B></A><P><UL><LI><A NAME="toc0" HREF="#sect0">Name</A></LI><LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI><LI><A NAME="toc2" HREF="#sect2">Description</A></LI><LI><A NAME="toc3" HREF="#sect3">Header Options</A></LI><LI><A NAME="toc4" HREF="#sect4">Info Options</A></LI><LI><A NAME="toc5" HREF="#sect5">Examples</A></LI><LI><A NAME="toc6" HREF="#sect6">Author</A></LI></UL></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?