Initial commit.

This commit is contained in:
依瑪貓 2020-11-30 07:20:14 +08:00
commit 708d2eaf0f
21 changed files with 2923 additions and 0 deletions

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
imacat <imacat@mail.imacat.idv.tw>

1
AUTHORS.zh-cn Normal file
View File

@ -0,0 +1 @@
依玛猫 <imacat@mail.imacat.idv.tw>

1
AUTHORS.zh-tw Normal file
View File

@ -0,0 +1 @@
依瑪貓 <imacat@mail.imacat.idv.tw>

674
COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

0
ChangeLog Normal file
View File

0
INSTALL Normal file
View File

0
INSTALL.zh-cn Normal file
View File

0
INSTALL.zh-tw Normal file
View File

0
NEWS Normal file
View File

0
README Normal file
View File

0
README.zh-cn Normal file
View File

0
README.zh-tw Normal file
View File

1
TODO Normal file
View File

@ -0,0 +1 @@
* Read presentation files list from the USB stick.

1
TODO.zh-cn Normal file
View File

@ -0,0 +1 @@
* 由 USB 随身碟取得简报档清单。

1
TODO.zh-tw Normal file
View File

@ -0,0 +1 @@
* 由 USB 隨身碟取得簡報檔清單。

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.01

46
build.xml Normal file
View File

@ -0,0 +1,46 @@
<?xml version="1.0"?>
<!-- build.xml: Ant build file for the mpresent project -->
<!-- by imacat <imacat@mail.imacat.idv.tw>, 2010-08-15 -->
<project name="mpresent" default="help" basedir=".">
<!-- property: The build variables -->
<loadfile property="project.version" srcfile="${basedir}/VERSION">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
<property name="build.dir" value="build" />
<property name="dist.build.dir" value="${build.dir}/dist" />
<property name="dist.dir" value="${basedir}" />
<!-- help: Display the help information -->
<target name="help">
<echo level="info" message="Available targets:" />
<echo level="info" message=" dist: Create the pacakge distribution as ${dist.dir}/${ant.project.name}-${project.version}.zip" />
<echo level="info" message=" clean: Clean-up the build files" />
<echo level="info" message=" help: Display this help" />
</target>
<!-- -distdir: Create the distribution directory -->
<target name="-distdir">
<copy todir="${dist.build.dir}/${ant.project.name}-${project.version}"
preservelastmodified="true">
<fileset dir="${basedir}"
excludes="${build.dir}/ ${ant.project.name}-*.zip" />
</copy>
</target>
<!-- dist: Create the pacakge distribution -->
<target name="dist" depends="-distdir">
<zip destfile="${dist.dir}/${ant.project.name}-${project.version}.zip"
basedir="${dist.build.dir}" />
</target>
<!-- clean: Clean-up the build files -->
<target name="clean">
<delete dir="${build.dir}" />
<delete file="${dist.dir}/${ant.project.name}-${project.version}.zip" />
<delete verbose="true">
<fileset file="${dist.dir}/${ant.project.name}-*.zip" />
</delete>
</target>
</project>

440
mpresent.en.html Normal file
View File

@ -0,0 +1,440 @@
<?xml version="1.0" encoding="US-ASCII" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="author" content="imacat" />
<meta name="copyright" content="&copy; 2010 imacat." />
<meta name="keywords" content="archive, Apache, Syslog, log files" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.zh-tw.html"
hreflang="zh-tw" title="&#27491;&#39636;&#20013;&#25991;" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.zh-cn.html"
hreflang="zh-cn" title="&#31616;&#20307;&#20013;&#25991;" />
<link rel="copyright" type="text/plain" href="fdl.txt" />
<link rel="author" href="mailto:imacat&#64;mail.imacat.idv.tw" />
<style type="text/css">
h2, em {
text-transform: uppercase;
}
.accessguide {
font-size: 0.5em;
float: left;
width: 0.5em;
}
cite {
quotes: "\00AB" "\00BB";
}
</style>
<title>mpresent Version 0.01</title>
</head>
<body>
<div class="langs" title="Language Switching Area">
<span xml:lang="zh-tw"><a href="mpresent.zh-tw.html"
title="&#20999;&#25563;&#21040;&#26412;&#38913;&#30340;&#27491;&#39636;&#20013;&#25991;&#29256;&#12290;"
hreflang="zh-tw">&#27491;&#39636;&#20013;&#25991;</a></span> |
<span xml:lang="zh-cn"><a href="mpresent.zh-cn.html"
title="&#20999;&#25442;&#21040;&#26412;&#39029;&#30340;&#31616;&#20307;&#20013;&#25991;&#29256;&#12290;"
hreflang="zh-cn">&#31616;&#20307;&#20013;&#25991;</a></span> |
<span>English</span>
</div>
<hr />
<div id="body" class="body" title="Page Content Area">
<div class="accessguide"><a accesskey="C"
href="#body" title="Page Content Area">:::</a></div>
<h1><samp>mpresent</samp> Version 0.01</h1>
<h2>What&rsquo;s New?</h2>
<dl>
<dt>2010-08-15</dt>
<dd>
<p>Re-release <samp>mpresent</samp> version 0.01 with license information.</p>
</dd>
<dt>2010-08-14</dt>
<dd>
<p>SourceForge project was applied. Raw package <samp>mpresent</samp> version 0.01 was released, with only the program file, but not any documentation or license. Presented on the <cite>OpenOffice.org UNO Magic</cite> talk on <abbr title="Conference for Open Source Coders, Users and Promoters">COSCUP</abbr> 2010.</p>
</dd>
</dl>
<h2>Description</h2>
<p><dfn><samp>mpresent</samp></dfn> is the Mobile OpenOffice.org Presentation Controller. It is a mobile web office application that turns your smart phone into a presentation controller. The smart phone connects to the presentation host through the <abbr title="transmission control protocol">TCP</abbr>/<abbr title="internet protocol">IP</abbr> network. Mostly this is through <abbr title="Wireless Fidelity">Wi-Fi</abbr>.</p>
<p><dfn><samp>mpresent</samp></dfn> is written in <abbr title="JavaServer Pages">JSP</abbr>.</p>
<h2>Caution</h2>
<ul>
<li><p><samp>mpresent</samp> does not include any authentication or security mechanism. You have to protect it yourself.</p></li>
</ul>
<h2>System Requirement</h2>
<ol>
<li><p>Linux or Solaris/OpenSolaris. Theorically <abbr title="microsoft">MS</abbr>-Windows should work, too, but I have not tested it yet. Please tell me if you do. <samp>mpresent</samp> requires Java and OpenOffice.org. The only platforms they both run that I know are Linux, Solaris/OpenSolaris and <abbr title="microsoft">MS</abbr>-Windows. If you successfully run it on other platforms, please let me know.</p></li>
<li><p>OpenOffice.org, version 3.0 or above. <samp>mpresent</samp> uses the <samp><a href="http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/Presentation2.html">com.sun.star.presentation.Presentation2</a></samp> service, which is only available since OpenOffice.org version 3.0. Most Linuxes come with OpenOffice.org 3 now. If you do not have it, or if your version is too old, you can download and install it from the <a href="http://www.openoffice.org/">OpenOffice.org website</a>.</p>
<p>Notice that the current version of Debian (Lenny) still comes with OpenOffice.org 2.4. If you are running this under Debian Lenny or earlier, you have to download and install OpenOffice.org from the OpenOffice.org website.</p>
</li>
<li><p>OpenOffice.org <abbr title="software development kit">SDK</abbr>, version 3.0 or above. <samp>mpresent</samp> uses the <samp><a href="http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/Presentation2.html">com.sun.star.presentation.Presentation2</a></samp> service, which is only available since OpenOffice.org <abbr title="software development kit">SDK</abbr> version 3.0. Most Linuxes come with OpenOffice.org 3 <abbr title="software development kit">SDK</abbr> in their package repository now.</p>
<ul>
<li><p>If you are running Ubuntu Linux, you can install the <samp>openoffice.org-dev</samp> package.</p></li>
<li><p>If you are running Fedora Linux, you can install the <samp>openoffice.org-core</samp> and <samp>openoffice.org-ure</samp> packages.</p></li>
<li><p>If you are running OpenSUSE Linux, you can install the <samp>OpenOffice_org-ure</samp> package.</p></li>
<li><p>If you do not have it, or if your version is too old, you can download and install it from the <a href="http://download.openoffice.org/sdk/">OpenOffice.org website</a>.</p></li>
</ul>
</li>
<li><p><abbr title="Java standard edition development kit">JDK</abbr>, version 1.5.0 or above. <samp>mpresent</samp> is written with generic types, which is a new feature
since Java 1.5. Sun released the free <a href="http://openjdk.java.net/"><acronym title="Open Java Development Kit">OpenJDK</acronym></a> since 2006. Till now, most Linux operating systems includes <acronym title="Open Java Development Kit">OpenJDK</acronym> in their package repositories.</p>
<ul>
<li><p>If you are running Debian or Ubuntu Linux, you can install the <samp>openjdk-6-jdk</samp> package.</p></li>
<li><p>If you are running Fedora or OpenSUSE Linux, you can install the <samp>java-1.6.0-openjdk</samp> package.</p></li>
<li><p>If you do not have it, or if your version is too old, you can download and install the Sun version from the <a href="http://www.oracle.com/technetwork/java/javase/">Java website</a>.</p></li>
</ul>
</li>
<li><p>Apache web server, version 2 or above. <samp>mpresent</samp> is a web application that requires a web server to run. <abbr title="microsoft">MS</abbr>-<abbr title="Internet Information Services">IIS</abbr> web server on <abbr title="microsoft">MS</abbr>-Windows should work, but I have not tested it yet. Please tell me if you do.</p>
<ul>
<li><p>If you are running Debian or Ubuntu Linux, you can install the <samp>apache2</samp> package.</p></li>
<li><p>If you are running Fedora or OpenSUSE Linux, you can install the <samp>httpd</samp> package.</p></li>
<li><p>If you do not have it, or if your version is too old, you can download and install it from the <a href="http://httpd.apache.org/">Apache website</a>.</p></li>
</ul>
</li>
<li><p>Apache Tomcat, version 5.5 or above. <samp>mpresent</samp> is a <abbr title="Java Server Page">JSP</abbr> application that requires a servlet container to run.</p>
<ul>
<li><p>If you are running Debian Linux, you can install the <samp>tomcat5.5</samp> package.</p></li>
<li><p>If you are running Ubuntu Linux, you can install the <samp>tomcat6</samp> package.</p></li>
<li><p>If you are running Fedora or openSUSE Linux, you can install the <samp>tomcat6</samp> package.</p></li>
<li><p>If you do not have it, or if your version is too old, you can download and install it from the <a href="http://tomcat.apache.org/">Apache Tomcat website</a>.</p></li>
</ul>
</li>
<li><p></p></li>
</ol>
<h2>Download</h2>
<p><samp>arclog</samp>&rsquo;s official websites is at&hellip;</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><samp>arclog</samp> web site at SourceForge</a></p></li>
<li><p><a href="https://sourceforge.net/projects/arclog/"><samp>arclog</samp> project page at SourceForge</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/"><samp>arclog</samp> project page at <abbr title="Comprehensive Perl Archive Network">CPAN</abbr></a></p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html"><samp>arclog</samp> page at Tavern IMACAT&rsquo;s</a></p></li>
</ul>
<p>You can always download the newest version of <samp>arclog</samp> from&hellip;</p>
<ul>
<li><p><a href="https://sourceforge.net/project/showfiles.php?group_id=62499"><samp>arclog</samp> download page at SourceForge</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/"><samp>arclog</samp>&rsquo;s project page at <abbr title="Comprehensive Perl Archive Network">CPAN</abbr></a></p></li>
<li><p><a href="ftp://ftp.imacat.idv.tw/pub/arclog/">Tavern IMACAT&rsquo;s <abbr title="File Transfer Protocol">FTP</abbr> directory</a></p></li>
</ul>
<p>imacat&rsquo;s <abbr title="Pretty Good Privacy">PGP</abbr> public key is at&hellip;</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/pgpkey.asc">imacat&rsquo;s <abbr title="Pretty Good Privacy">PGP</abbr> key at <samp>arclog</samp> SourceForge web site</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/me/pgpkey.asc">imacat&rsquo;s <abbr title="Pretty Good Privacy">PGP</abbr> key at Tavern IMACAT&rsquo;s</a></p></li>
</ul>
<h2>Install</h2>
<p>If you are upgrading from <samp>arclog.pl</samp> 2.1.1dev4 or earlier, please read <samp>UPGRADE</samp> for some upgrade instruction.</p>
<h3>Install with <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><samp>ExtUtils::MakeMaker</samp></a></h3>
<p><samp>arclog</samp> uses standard <acronym title="Practical Extraction and Reporting Language">Perl</acronym> installation with <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><samp>ExtUtils::MakeMaker</samp></a>. Follow these steps:</p>
<blockquote><pre>
% perl Makefile.PL
% make
% make test
% make install
</pre></blockquote>
<p>When running <q><samp>make install</samp></q>, make sure you have the priviledge to write to the installation location. This usually requires the <samp>root</samp> priviledge.</p>
<p>If you are using ActivePerl under <abbr title="Microsoft">MS</abbr>-Windows, you should use <samp>nmake</samp> instead of <samp>make</samp>. <a href="ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe" type="application/x-dosexec"><samp>nmake</samp> can be obtained from the Microsoft <abbr title="File Transfer Protocol">FTP</abbr> site.</a></p>
<p>If you want to install into another location, you can set the <samp>PREFIX</samp>. For example, to install into your home when you are not <samp>root</samp>:</p>
<blockquote><pre>
% perl Makefile.PL PREFIX=/home/jessica
</pre></blockquote>
<p>Refer to the docuemntation of <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><samp>ExtUtils::MakeMaker</samp></a> for more installation options (by running <q><samp>perldoc ExtUtils::MakeMaker</samp></q>).</p>
<h3>Install with <a href="http://search.cpan.org/dist/Module-Build/"><samp>Module::Build</samp></a></h3>
<p>You can install with <a href="http://search.cpan.org/dist/Module-Build/"><samp>Module::Build</samp></a> instead, if you prefer. Follow these steps:</p>
<blockquote><pre>
% perl Build.PL
% ./Build
% ./Build test
% ./Build install
</pre></blockquote>
<p>When running <q><samp>./Build install</samp></q>, make sure you have the priviledge to write to the installation location. This usually requires the <samp>root</samp> priviledge.</p>
<p>If you want to install into another location, you can set the <samp>--prefix</samp>. For example, to install into your home when you are not <samp>root</samp>:</p>
<blockquote><pre>
% perl Build.PL --prefix=/home/jessica
</pre></blockquote>
<p>Refer to the docuemntation of <a href="http://search.cpan.org/dist/Module-Build/"><samp>Module::Build</samp></a> for more installation options (by running <q><samp>perldoc Module::Build</samp></q>).</p>
<h2>Options</h2>
<pre>
./arclog [options] logfile&hellip; [output]
./arclog [-h|-v]
</pre>
<dl>
<dt><var>logfile</var></dt>
<dd>
<p>The log file to be archived. Specify <q><samp>-</samp></q> to read from <samp>STDIN</samp>. Multiple log files are supported. <samp>gzip</samp> or <samp>bzip2</samp> compressed files are supported, too.</p>
</dd>
<dt><var>output</var></dt>
<dd>
<p>The prefix of the output files. The output files will be named as <samp>output.<var>yyyymm</var></samp>, <abbr title="id est">i.e.</abbr>, <samp>output.200101</samp>, <samp>output.200102</samp>. If not specified, the default is the same as the log file. You must specify this if you want to read from <samp>STDIN</samp>. You cannot specify <q><samp>-</samp></q> (<samp>STDIN</samp>), since this is only a name prefix, not the output file.</p>
</dd>
<dt>-c, --compress <var>method</var></dt>
<dd>
<p>Specify the compression method for the archived files. Log files usually have large number of simular lines. Compress them saves you lots of disk spaces. (And this is why we want to <em>archive</em> them.) Currently the following compression methods are supported:</p>
<dl>
<dt>g, gzip</dt>
<dd>
<p>Compress with <samp>gzip</samp>. This is the default. <samp>arclog</samp> can use <a href="http://search.cpan.org/dist/Compress-Zlib/"><samp>Compress::Zlib</samp></a> to compress instead of calling <samp>gzip</samp>. This can be safer and faster for not calling foreign binaries. But if <a href="http://search.cpan.org/dist/Compress-Zlib/"><samp>Compress::Zlib</samp></a> is not installed, it will try to use <samp>gzip</samp> binary instead. If <samp>gzip</samp> binary is not available, either, but <samp>gzip</samp> compression is required, the program will fail.</p>
</dd>
<dt>b, bzip2</dt>
<dd>
<p>Compress with <samp>bzip2</samp>. <samp>arclog</samp> can use <a href="http://search.cpan.org/dist/Compress-Bzip2/"><samp>Compress::Bzip2</samp></a> to compress instead of calling <samp>bzip2</samp>. This can be safer and faster for not calling foreign binaries. But if <a href="http://search.cpan.org/dist/Compress-Bzip2/"><samp>Compress::Bzip2</samp></a> is not installed, it will try to use <samp>bzip2</samp> binary instead. If <samp>bzip2</samp> binary is not available, either, but <samp>bzip2</samp> compression is required, the program will fail.</p>
</dd>
<dt>n, none</dt>
<dd>
<p>No compression at all. (Why? :p)</p>
</dd>
</dl>
</dd>
<dt>--nocompress</dt>
<dd>
<p>Do not compress the archived files. This is equal to <q><samp>--compress none</samp></q>.</p>
</dd>
<dt>-s, --sort</dt>
<dd>
<p>Sort the records by time (and then the record order). Sorting eats huge memory and <abbr title="central processing unit">CPU</abbr>, so it is disabled by default. See the description above for a detailed illustration on sorting.</p>
</dd>
<dt>--nosort</dt>
<dd>
<p>Do not sort the records. This is the default.</p>
</dd>
<dt>-o, --override <var>mode</var></dt>
<dd>
<p>Whether we should overwrite the existing archived files. Currently the following modes are supported:</p>
<dl>
<dt>o, overwrite</dt>
<dd>
<p>Overwrite existing target files. You will lost these existing records. Use with care. This is helpful if you are sure the master log file has the most complete records.</p>
</dd>
<dt>a, append</dt>
<dd>
<p>Append the records to the existing target files. You may destroy the log file completely by putting irrelevant entries altogether accidently. Use with care. This is helpful if you append want to merge 2 or more log files, for <abbr title="example">ex.</abbr>, 2 log files of different periods.</p>
</dd>
<dt>i, ignore</dt>
<dd>
<p>Ignore any existing target file, and discard all the records of those months. You will lost these log records. Use with care. This is helpful if you are supplying log records for the missing months, or if you are merging the log records in a complex manner.</p>
</dd>
<dt>f, fail</dt>
<dd>
<p>Stop processing whenever a target file exists, to prevent destroying existing files by accident. This should be mostly wanted when run from some automatic mechanism, like <samp>crontab</samp>. So, this is the default if no terminal is found at <samp>STDIN</samp>.</p>
</dd>
<dt>ask</dt>
<dd>
<p>Ask you what to do when a target file exists. This should be most wanted if you are running <samp>arclog</samp> interactively. So, this is the default if a terminal is found at <samp>STDIN</samp>. The answers are read from <samp>STDIN</samp>. Since you have only one <samp>STDIN</samp>, you cannot specify this mode if you want read the log file from <samp>STDIN</samp>. In that case, it will fall back to the <samp>fail</samp> mode. Also, if <samp>arclog</samp> cannot get its answer from <samp>STDIN</samp>, for <abbr title="example">ex.</abbr>, on a closed <samp>STDIN</samp> like <samp>crontab</samp>, it will fall back to <samp>fail</samp> mode.</p>
</dd>
</dl>
</dd>
<dt>-k, --keep <var>mode</var></dt>
<dd>
<p>What to keep in the source file. Current the following modes are supported:</p>
<dl>
<dt>a, all</dt>
<dd>
<p>Keep the source file after records are archived.</p>
</dd>
<dt>r, restart</dt>
<dd>
<p>Restart the source log file after records are archived.</p>
</dd>
<dt>d, delete</dt>
<dd>
<p>Delete the source log file after records are archived.</p>
</dd>
<dt>t, this-month</dt>
<dd>
<p>Archive and strip records of previous months off from the log file. Keep the records of this month in the source log file, to be archived next month. This is designed to be run from <samp>crontab</samp> monthly, so this is the default.</p>
</dd>
</dl>
</dd>
<dt>-d, --debug</dt>
<dd>
<p>Show the detailed debugging messages.</p>
</dd>
<dt>-q, --quiet</dt>
<dd>
<p>Shihhhhhh. Only yell when errors.</p>
</dd>
<dt>-h, --help</dt>
<dd>
<p>Display the help message and exit.</p>
</dd>
<dt>-v, --version</dt>
<dd>
<p>Output version information and exit.</p>
</dd>
</dl>
<h2>Copyright</h2>
<p>Copyright &copy; 2001-2007 imacat..</p>
<p>This program is free software: you can redistribute it and/or modify it under the terms of the <cite><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> General Public License</cite> as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but <em>without any warranty</em>; without even the implied warranty of <em>merchantability</em> or <em>FITNESS FOR A PARTICULAR PURPOSE</em>. See the <cite><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> General Public License</cite> for more details.</p>
<p>You should have received a copy of the <cite><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> General Public License</cite> along with this program. If not, see <samp>&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;</samp>.</p>
<h2>Release Notes</h2>
<p>Please read the <samp>NEWS</samp> for the new functions and bug fixes.</p>
<h2>Support</h2>
<p><samp>arclog</samp> is hosted on <a href="https://sourceforge.net/">SourceForge</a>, <a href="http://www.cpan.org/"><acronym title="Comprehensive Perl Archive Network">CPAN</acronym></a> and <a href="http://www.imacat.idv.tw/">Tavern IMACAT&rsquo;s</a>. For the latest infomation, see</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><samp>arclog</samp> web site at SourceForge</a>.</p></li>
<li><p><a href="http://sourceforge.net/projects/arclog/"><samp>arclog</samp> project page at SourceForge</a>.</p></li>
<li><p><a href="http://search.cpan.org/dist/arclog/"><samp>arclog</samp> project page at <abbr title="Comprehensive Perl Archive Network">CPAN</abbr></a>.</p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html"><samp>arclog</samp> page at Tavern IMACAT&rsquo;s</a>.</p></li>
</ul>
<p>There is a <a href="mailto:arclog-users&#64;lists.sourceforge.net"><samp>arclog</samp> mailing list</a> hosted at <a href="https://sourceforge.net/">SourceForge</a>. Please submit your questions, suggestions or bug reports there. It is a <a href="http://www.list.org/">Mailman</a> mailing list. For more information, see the <a href="https://lists.sourceforge.net/lists/listinfo/arclog-users"><samp>arclog</samp> mailing list page</a>. Alternatively, you can send a mail to the <a href="mailto:arclog-users-request&#64;lists.sourceforge.net"><acronym title="electronic mail">e-mail</acronym> command mailbox</a> with the subject <samp>help</samp> for a list of available <acronym title="electronic mail">e-mail</acronym> commands.</p>
</div>
<hr />
<div id="footer" class="footer" title="Page Footer Area">
<address>By <a href="mailto:imacat&#64;mail.imacat.idv.tw">imacat</a>, first version 2001-06-08, last updated 2008-11-18</address>
<address>Copyright &copy; 2010 imacat. Please read the <a href="fdl.txt">copyright</a> before copying.</address>
</div>
</body>
</html>

725
mpresent.jsp Normal file
View File

@ -0,0 +1,725 @@
<%
/*
* mpresent.jsp
*
* Created on 2010-07-13 (Original CGI 2010-07-07)
*
* Copyright (c) 2010 imacat
*
* version 0.01
*/
%><%@ page
contentType="text/html; charset=utf-8"
import="com.sun.star.beans.PropertyValue"
import="com.sun.star.bridge.XUnoUrlResolver"
import="com.sun.star.comp.helper.Bootstrap"
import="com.sun.star.frame.XDesktop"
import="com.sun.star.lang.XComponent"
import="com.sun.star.lang.XMultiComponentFactory"
import="com.sun.star.uno.UnoRuntime"
import="com.sun.star.uno.XComponentContext"
import="com.sun.star.ucb.XFileIdentifierConverter"
import="com.sun.star.container.XEnumeration"
import="com.sun.star.container.XEnumerationAccess"
import="com.sun.star.frame.XModel"
import="com.sun.star.lang.XServiceInfo"
import="com.sun.star.drawing.XDrawPages"
import="com.sun.star.drawing.XDrawPagesSupplier"
import="com.sun.star.frame.XComponentLoader"
import="com.sun.star.presentation.XPresentation"
import="com.sun.star.presentation.XPresentation2"
import="com.sun.star.presentation.XPresentationSupplier"
import="com.sun.star.presentation.XSlideShowController"
import="java.util.Hashtable"
import="java.util.Vector"
%><%!
/** The servlet request */
private HttpServletRequest r = null;
/** The desktop service. */
private Object desktop = null;
/** The bootstrap context. */
private XComponentContext bootstrapContext = null;
/** The registry service manager. */
private XMultiComponentFactory serviceManager = null;
/** The document. */
private XComponent doc = null;
/** The action type. */
private ActionType action = null;
/** The file. */
private String file = null;
/** The current slide index. */
private int currentSlide = -1;
/** The goto slide index. */
private int slide = -1;
/** The slide indeces of all the opened presentations. */
private Hashtable<String,Integer> savedSlideIndeces
= new Hashtable<String,Integer>();
/** The presentation document files. */
private Vector<PresentationFile> allFiles
= new Vector<PresentationFile>();
/**
* Parses the arguments.
*
*/
private void parseArguments() {
this.action = null;
this.file = null;
this.currentSlide = -1;
this.slide = -1;
if (this.allFiles.size() == 0) {
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic.odp",
"OpenOffice.org的UNO魔術"));
this.allFiles.add(new PresentationFile(
"/home/imacat/(一)初級篇.odp",
"Perl Regular Expression初級篇"));
this.allFiles.add(new PresentationFile(
"/home/imacat/(二)進階篇.odp",
"Perl Regular Expression進階篇"));
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic-real.odp",
"真•OpenOffice.org的UNO魔術"));
this.allFiles.add(new PresentationFile(
"/home/imacat/ooomagic-real-real.odp",
"真•真•OpenOffice.org的UNO魔術"));
}
try {
this.r.setCharacterEncoding("UTF-8");
} catch (java.io.UnsupportedEncodingException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (this.r.getMethod().equals("POST")) {
if (this.r.getParameter("start") != null) {
this.action = ActionType.START;
} else if (this.r.getParameter("next") != null) {
this.action = ActionType.NEXT;
} else if (this.r.getParameter("previous") != null) {
this.action = ActionType.PREVIOUS;
} else if (this.r.getParameter("stop") != null) {
this.action = ActionType.STOP;
} else if (this.r.getParameter("goto") != null) {
this.action = ActionType.GOTO;
} else if (this.r.getParameter("close") != null) {
this.action = ActionType.CLOSE;
}
this.file = this.r.getParameter("file");
if (this.r.getParameter("slide") != null && !this.r.getParameter("slide").equals("")) {
this.slide = Integer.parseInt(this.r.getParameter("slide")) - 1;
}
}
return;
}
/**
* Shows the HTML presentation controller page.
*
* @return the HTML of the page
*/
private String showHTML() {
String html = null;
String script = this.r.getServletPath();
int pos = 0;
pos = script.lastIndexOf('/');
script = script.substring(pos + 1);
html = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n"
+ " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"zh-tw\">\n"
+ "<head>\n"
+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.5\" />\n"
+ "<title>簡報遙控</title>\n"
+ "</head>\n"
+ "<body>\n";
if (this.doc != null) {
XDrawPagesSupplier xDrawPagesSupplier = null;
int count = -1;
xDrawPagesSupplier = (XDrawPagesSupplier)
UnoRuntime.queryInterface(
XDrawPagesSupplier.class, this.doc);
count = xDrawPagesSupplier.getDrawPages().getCount();
html += "<form action=\"" + script + "\" method=\"POST\">\n"
+ "<div>\n"
+ "<input type=\"hidden\" name=\"file\" value=\""
+ this.file + "\" />\n"
+ "<input type=\"submit\" name=\"stop\" value=\"■\" />\n"
+ "<input type=\"submit\" name=\"previous\" value=\"◀◀\" />\n"
+ "<input type=\"submit\" name=\"start\" value=\"▶\" />\n"
+ "<input type=\"submit\" name=\"next\" value=\"▶▶\" />\n"
+ "</div>\n"
+ "<div>&nbsp;</div>\n";
html += "<div>\n"
+ "<select name=\"slide\">\n";
for (int i = 0; i < count; i++) {
html += " <option value=\"" + (i + 1) + "\""
+ (i == this.currentSlide? " selected=\"selected\"": "")
+ ">" + (i + 1) + "</option>\n";
}
html += "</select>\n"
+ "<input type=\"submit\" name=\"goto\" value=\"Go\" />\n"
+ "<input type=\"submit\" name=\"close\" value=\"▲ \" />\n"
+ "</div>\n"
+ "</form>\n";
}
html += "<form action=\"" + script + "\" method=\"POST\">\n"
+ "<div><select name=\"file\">\n";
for (int i = 0; i < this.allFiles.size(); i++) {
PresentationFile thisFile = this.allFiles.get(i);
html += " <option"
+ " value=\"" + thisFile.getFile() + "\""
+ (this.file != null && this.file.equals(thisFile.getFile())?
" selected=\"selected\"": "")
+ ">" + thisFile.getTitle() + "</option>\n";
}
html += "</select></div>\n"
+ "<input type=\"submit\" name=\"start\" value=\"▶\" />\n"
+ "</div>\n"
+ "</form>\n"
+ "</body>\n"
+ "</html>";
return html;
}
/**
* Connects to the OpenOffice.org process.
*
* @param host specifies the host name
* @param port specifies the port number
* @throws com.sun.star.comp.helper.BootstrapException if fails to
* create the initial component context
* @throws com.sun.star.connection.NoConnectException if no one
* is accepting on the specified resource.
* @throws com.sun.star.connection.ConnectionSetupException if
* it is not possible to accept on a local resource
*/
private void connect(String host, int port)
throws com.sun.star.comp.helper.BootstrapException,
com.sun.star.connection.NoConnectException,
com.sun.star.connection.ConnectionSetupException {
boolean doConnect = false;
XComponentContext localContext;
XMultiComponentFactory localServiceManager = null;
Object unoUrlResolver = null;
XUnoUrlResolver xUnoUrlResolver = null;
Object bootstrapContext = null;
if (this.desktop == null) {
doConnect = true;
} else {
try {
UnoRuntime.queryInterface(XDesktop.class, this.desktop);
} catch (com.sun.star.lang.DisposedException e) {
doConnect = true;
}
}
if (!doConnect) {
return;
}
// Obtain the local context
try {
localContext = Bootstrap.createInitialComponentContext(null);
} catch (java.lang.Exception e) {
throw new com.sun.star.comp.helper.BootstrapException(e);
}
if (localContext == null) {
throw new com.sun.star.comp.helper.BootstrapException(
"Failed to obtain the local OpenOffice.org component context.");
}
// Obtain the local service manager
localServiceManager = localContext.getServiceManager();
// Obtain the URL resolver
try {
unoUrlResolver = localServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(
XUnoUrlResolver.class, unoUrlResolver);
// Obtain the context
try {
bootstrapContext = xUnoUrlResolver.resolve(String.format(
"uno:socket,host=%s,port=%d;urp;StarOffice.ComponentContext",
host, port));
} catch (com.sun.star.connection.NoConnectException e) {
throw e;
} catch (com.sun.star.connection.ConnectionSetupException e) {
throw e;
} catch (com.sun.star.lang.IllegalArgumentException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (bootstrapContext == null) {
throw new java.lang.UnsupportedOperationException(
String.format("Failed to connect to OpenOffice.org at %s:%d.",
host, port));
}
this.bootstrapContext = (XComponentContext) UnoRuntime.queryInterface(
XComponentContext.class, bootstrapContext);
// Obtain the service manager
this.serviceManager = this.bootstrapContext.getServiceManager();
// Obtain the desktop service
try {
this.desktop = this.serviceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
}
/**
* Finds the already-opened document.
*
*/
private void findDocument() {
Object fileContentProvider = null;
XFileIdentifierConverter xFileIdentifierConverter = null;
String url = null;
XDesktop xDesktop = null;
XEnumerationAccess xEnumerationAccess = null;
XEnumeration xEnumeration = null;
boolean isRunning = false;
try {
fileContentProvider
= this.serviceManager.createInstanceWithContext(
"com.sun.star.ucb.FileContentProvider",
this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xFileIdentifierConverter = (XFileIdentifierConverter)
UnoRuntime.queryInterface(
XFileIdentifierConverter.class, fileContentProvider);
url = xFileIdentifierConverter.getFileURLFromSystemPath(
"", this.file);
this.doc = null;
// Obtain all the components
xDesktop = (XDesktop) UnoRuntime.queryInterface(
XDesktop.class, this.desktop);
xEnumerationAccess = xDesktop.getComponents();
xEnumeration = xEnumerationAccess.createEnumeration();
while (xEnumeration.hasMoreElements()) {
Object component = null;
XServiceInfo xServiceInfo = null;
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XModel xModel = null;
boolean isThisDocument = false;
try {
component = xEnumeration.nextElement();
} catch (com.sun.star.container.NoSuchElementException e) {
throw new java.util.NoSuchElementException(e.getMessage());
} catch (com.sun.star.lang.WrappedTargetException e) {
throw new java.lang.RuntimeException(e);
}
xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(
XServiceInfo.class, component);
if (xServiceInfo == null) {
continue;
}
if (!xServiceInfo.supportsService(
"com.sun.star.presentation.PresentationDocument")) {
continue;
}
xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, component);
if (url.equals(xModel.getURL())) {
this.doc = (XComponent) UnoRuntime.queryInterface(
XComponent.class, component);
isThisDocument = true;
}
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, component);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
if (!isThisDocument && xPresentation2.isRunning()) {
XSlideShowController xSlideShowController
= xPresentation2.getController();
this.savedSlideIndeces.put(xModel.getURL(),
xSlideShowController.getCurrentSlideIndex());
xPresentation2.end();
}
}
}
/**
* Opens the presentation document.
*
* @throws java.io.IOException when file couldn't be found or was
corrupt
*/
private void open()
throws java.io.IOException {
Object fileContentProvider = null;
XFileIdentifierConverter xFileIdentifierConverter = null;
String url = null;
XComponentLoader xComponentLoader = null;
PropertyValue props[] = new PropertyValue[0];
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
if (this.doc == null) {
try {
fileContentProvider
= this.serviceManager.createInstanceWithContext(
"com.sun.star.ucb.FileContentProvider",
this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
xFileIdentifierConverter = (XFileIdentifierConverter)
UnoRuntime.queryInterface(
XFileIdentifierConverter.class, fileContentProvider);
// Open the file
url = xFileIdentifierConverter.getFileURLFromSystemPath(
"", this.file);
xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(
XComponentLoader.class, this.desktop);
try {
this.doc = xComponentLoader.loadComponentFromURL(
url, "_default", 0, props);
} catch (com.sun.star.io.IOException e) {
throw new java.io.IOException(e);
} catch (com.sun.star.lang.IllegalArgumentException e) {
throw new java.lang.IllegalArgumentException(e);
}
if (this.savedSlideIndeces.containsKey(url)) {
this.savedSlideIndeces.remove(url);
}
}
// Obtain the presentation
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
// Obtain the current slide
if (xPresentation2.isRunning()) {
xSlideShowController = xPresentation2.getController();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
// Start the presentation if not started yet
} else {
if (this.action != ActionType.STOP) {
XModel xModel = null;
xPresentation2.start();
while (!xPresentation2.isRunning()) { }
xSlideShowController = xPresentation2.getController();
xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, this.doc);
url = xModel.getURL();
if (this.savedSlideIndeces.containsKey(url)) {
this.currentSlide = this.savedSlideIndeces.get(url);
} else {
this.currentSlide = -1;
}
// Go to the current slide
if (this.currentSlide == -1) {
if (xSlideShowController.getCurrentSlideIndex() != 0) {
xSlideShowController.gotoSlideIndex(0);
}
} else {
if ( xSlideShowController.getCurrentSlideIndex()
!= this.currentSlide) {
xSlideShowController.gotoSlideIndex(this.currentSlide);
}
}
// Redraw the screen for sometimes the screen is black
xSlideShowController.gotoNextSlide();
try {
Thread.currentThread().sleep(50);
} catch (java.lang.InterruptedException e) {
}
xSlideShowController.gotoPreviousSlide();
}
}
return;
}
/**
* Starts the presentation.
*
*/
private void start() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Goes to the next slide.
*
*/
private void gotoNextSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoNextSlide();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Goes to the previous slide.
*
*/
private void gotoPreviousSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoPreviousSlide();
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Stops the presentation
*
*/
private void stop() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
if (xPresentation2.isRunning()) {
XSlideShowController xSlideShowController
= xPresentation2.getController();
XModel xModel = (XModel) UnoRuntime.queryInterface(
XModel.class, this.doc);
this.savedSlideIndeces.put(xModel.getURL(),
xSlideShowController.getCurrentSlideIndex());
xPresentation.end();
}
return;
}
/**
* Goes to a specific slide.
*
*/
private void gotoSlide() {
XPresentationSupplier xPresentationSupplier = null;
XPresentation xPresentation = null;
XPresentation2 xPresentation2 = null;
XSlideShowController xSlideShowController = null;
xPresentationSupplier = (XPresentationSupplier)
UnoRuntime.queryInterface(
XPresentationSupplier.class, this.doc);
xPresentation = xPresentationSupplier.getPresentation();
xPresentation2 = (XPresentation2) UnoRuntime.queryInterface(
XPresentation2.class, xPresentation);
xSlideShowController = xPresentation2.getController();
xSlideShowController.gotoSlideIndex(this.slide);
this.currentSlide = xSlideShowController.getCurrentSlideIndex();
return;
}
/**
* Closes the presentation document.
*
*/
private void close() {
this.doc.dispose();
this.doc = null;
return;
}
/**
* The action type.
*
* @author <a href="mailto:imacat&#64;mail.imacat.idv.tw">imacat</a>
* @version 0.01
*/
private enum ActionType {
/** Starts the presentation. */
START,
/** Goes to the next slide. */
NEXT,
/** Goes to the previous slide. */
PREVIOUS,
/** Stop the presentation. */
STOP,
/** Goes to a specific slide. */
GOTO,
/** Closes the presentation document. */
CLOSE;
}
/**
* The presentation file.
*
* @author <a href="mailto:imacat&#64;mail.imacat.idv.tw">imacat</a>
* @version 0.01
*/
private class PresentationFile {
/** The document file. */
private String file = null;
/** The document title. */
private String title = null;
/**
* Creates a new instance of PresentationFile.
*
* @param file the document file
* @param title the document title
*/
private PresentationFile(String file, String title) {
this.file = file;
this.title = title;
}
/**
* Returns the document file.
*
* @return the document file
*/
private String getFile() {
return this.file;
}
/**
* Returns the document title.
*
* @return the document title
*/
private String getTitle() {
return this.title;
}
}
%><%
this.r = request;
this.parseArguments();
if (this.action != null) {
this.connect("localhost", 2002);
this.findDocument();
this.open();
switch (this.action) {
case START:
this.start();
break;
case NEXT:
this.gotoNextSlide();
break;
case PREVIOUS:
this.gotoPreviousSlide();
break;
case STOP:
this.stop();
break;
case CLOSE:
this.stop();
this.close();
break;
case GOTO:
this.gotoSlide();
break;
}
}
out.print(this.showHTML());
%>

513
mpresent.zh-cn.html Normal file
View File

@ -0,0 +1,513 @@
<?xml version="1.0" encoding="GB2312" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="author" content="依玛猫" />
<meta name="copyright" content="&copy; 2010 依玛猫。" />
<meta name="keywords" content="整理, Apache, Syslog, 记录档" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.zh-tw.html"
hreflang="zh-tw" title="正體中文" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.en.html"
hreflang="en-us" title="English" />
<link rel="copyright" type="text/plain" href="fdl.txt" />
<link rel="author" href="mailto:imacat&#64;mail.imacat.idv.tw" />
<style type="text/css">
h2, em {
text-transform: uppercase;
}
.accessguide {
font-size: 0.5em;
float: left;
width: 0.5em;
}
q {
quotes: "“" "”" "" "";
}
cite {
quotes: "《" "》";
}
</style>
<title>mpresent 0.01 版</title>
</head>
<body>
<div class="langs" title="语言切换区">
<span xml:lang="zh-tw"><a href="mpresent.zh-tw.html"
title="切換到本頁的正體中文版。"
hreflang="zh-tw">正體中文</a></span> |
<span>简体中文</span> |
<span xml:lang="en-us"><a href="mpresent.en.html"
title="Switch to the English version of this page."
hreflang="en-us">English</a></span>
</div>
<hr />
<div id="body" class="body" title="网页内文区">
<div class="accessguide"><a accesskey="C"
href="#body" title="网页内文区">:::</a></div>
<h1><samp xml:lang="en">mpresent</samp> 0.01 版</h1>
<h2>最新消息</h2>
<dl>
<dt>2007-12-03</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 0.01 。说明文件修正。若你之前安装了 <samp xml:lang="en">arclog</samp> 3.00 版或之后的版本,不需要升级新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-0.01.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog</samp> 0.01 版</a></p>
</dd>
<dt>2007-12-03</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.03 。修正测试套件。所需 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 版本号码改用相容於旧版的号码格式,以消除 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 5.10 的警告讯息。若你之前安装了 <samp xml:lang="en">arclog</samp> 3.00 版或之后的版本,不需要升级新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.03.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog</samp> 3.03 版</a></p>
</dd>
<dt>2007-11-30</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.02 。修正测试套件,以处理日光节约时间问题。若你之前安装了 <samp xml:lang="en">arclog</samp> 3.00 版或之后的版本,不需要升级新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.02.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog</samp> 3.02 版</a></p>
</dd>
<dt>2007-11-28</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.01 。修正测试套件,以协助厘清 <abbr title="Comprehensive Perl Archive Network">CPAN</abbr> 测试回报的错误。若你之前安装了 <samp xml:lang="en">arclog</samp> 3.00 版,不需要升级新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.01.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog</samp> 3.01 版</a></p>
</dd>
<dt>2007-11-28</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.00 。从 <a href="http://www.imacat.idv.tw/tech/reslog.html"><samp xml:lang="en">reslog</samp></a> 借过来的全新程式码,档名也从 <samp xml:lang="en">arclog.pl</samp> 改为 <samp xml:lang="en">arclog</samp> 。新的物件导向处理器,可顺利处理各种压缩法及档案格式。安装系统由 <a href="http://www.gnu.org/software/autoconf/"><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> <samp>autoconf</samp></a> 改用 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym><a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><samp>ExtUtils::MakeMaker</samp></a><a href="http://search.cpan.org/dist/Module-Build/"><samp>Module::Build</samp></a> 。新加上完整的测试套件,协助程式品管。版权更新为 <a href="http://www.gnu.org/licenses/gpl-3.0.html" hreflang="en" xml:lang="en"><abbr title="GNU General Public License version 3" xml:lang="en">GPLv3</abbr></a><a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.00.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog</samp> 3.00 版</a></p>
</dd>
<dt>2002-09-26</dt>
<dd>
<p><samp xml:lang="en">arclog.pl</samp> 最新版本 2.1.0 。这是 2.1.0 的最终版,加上了 <samp xml:lang="en">bzip2</samp> 压缩的支援,用 <samp xml:lang="en">gzip</samp> 程式代替 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> 压缩,并改用 <a href="http://www.gnu.org/software/autoconf/" hreflang="en" xml:lang="en"><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> <samp>autoconf</samp></a> 安装设定程式。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog.pl-2.1.0.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog.pl</samp> 2.1.0</a></p>
</dd>
<dt>2002-09-18</dt>
<dd>
<p><samp xml:lang="en">arclog.pl</samp> 最新版本 2.1.0dev2 。本版修正了几个说明文件的错误,并把 <a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a> 加进 <samp xml:lang="en">arclog.pl</samp> 的下载网址中。你可以把它当做<q>申请 <span xml:lang="en">SourceForge</span> 纪念版</q>。原则上,不需要急著升级。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog.pl-2.1.0dev2.tar.gz" type="application/x-gzip">下载 <samp xml:lang="en">arclog.pl</samp> 2.1.0dev2</a></p>
</dd>
<dt>2002-09-17</dt>
<dd>
<p>好消息! <samp xml:lang="en">arclog.pl</samp> 已开始架设於 <a href="https://sourceforge.net/projects/arclog/" xml:lang="en">SourceForge</a> 罗!(虽然我几乎还完全搞不清楚要怎么架…摸索中… ^^; </p>
</dd>
</dl>
<h2>说明</h2>
<p><dfn xml:lang="en"><samp>arclog</samp></dfn> 是记录档每月归档程式,将记录档中,前月的记录按月份压缩归档,以节省硬碟空间,并避免记录档被有心人士破坏。</p>
<p><samp xml:lang="en">arclog</samp> 目前支援 <a href="http://httpd.apache.org/" hreflang="en" xml:lang="en">Apache</a><span xml:lang="en">Syslog</span><a href="http://www.ntp.org/" hreflang="en" xml:lang="en"><abbr title="network time protocol">NTP</abbr></a><span xml:lang="en">Apache 1 <abbr title="secure socket layer">SSL</abbr> engine log</span> 及我自己用的括弧 <acronym title="International Organization for Standardization" xml:lang="en">ISO</acronym> 修正格式五种格式的记录档,与 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 两种压缩法。很多程式都可以用 <span xml:lang="en">Apache</span> 相容记录档格式记录,如 <a href="http://www.cups.org/" hreflang="en" xml:lang="en"><abbr title="Common UNIX Printing System">CUPS</abbr></a><a href="http://www.proftpd.org/" hreflang="en" xml:lang="en">ProFTPD</a><a href="http://www.pureftpd.org/" hreflang="en" xml:lang="en">Pure-FTPd</a>&hellip;等, <samp xml:lang="en">arclog</samp> 也可以归档这些 <span xml:lang="en">Apache</span> 相容格式的记录档。</p>
<h2>注意事项</h2>
<ul>
<li><p>归类记录档<em>很耗时间</em>。为减少占用原记录档的时间, <samp xml:lang="en">arclog</samp> 会先把原记录档复制到暂时工作档,视需要把原记录档归零,再慢慢在暂时工作档上作业。不过仍请注意下列事项:</p>
<ol>
<li><p>如果原记录档很大(好几百 <abbr title="megabyte" xml:lang="en">MB</abbr> ),光复制档案就很花时间了。这种情况下,最好先关闭记录程式,等整理完以后,再继续记录,以避免记录错乱。若平常有定期归档,记录档就不会无限制膨胀了。</p></li>
<li><p><samp xml:lang="en">arclog</samp> 执行到一半因故中断,会留下残存的暂时工作档。日后 <samp xml:lang="en">arclog</samp> 执行时,碰到之前残存的暂时工作档,会停止执行。要先处理掉之前的暂时工作档,才能继续。暂时工作档只是原档的复本,只要改个档名再归档一次,就可以了。</p></li>
</ol>
</li>
<li><p>没有特别理由,最好不要排序。排序的潜在问题如下:</p>
<ol>
<li><p>记录档很大时,排序<em>会吃掉很多记忆体</em>。所需记忆体依归档后每个月记录笔数而定。新版的 <span xml:lang="en">Linux</span><span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 系统有记忆体耗用保护,会中断吃掉太多记忆体的程式,不过这还是要花好几分钟,这几分钟内系统会完全当掉不动。我不知道别的作业系统有没有记忆体耗用保护。如果你要玩,风险自负。</p></li>
<li><p>所有支援的记录档格式,时间最小单位为<em><q></q></em>。同一秒内的记录会先以记录档顺序(若同时归档好几个记录档),再以记录本身出现的次序排序。这样设计尽可能让排序归档后同一秒内的记录次序,和事件真正的发生顺序一致,但也无法完全保证。若同一秒内的事件次序很重要,你要自行小心。</p></li>
</ol>
</li>
<li><p>归档 <span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 记录档时,请特别注意: <em><span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 记录档没有记年。</em> <samp xml:lang="en">arclog</samp><a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a> 模组解读时间。无年份时, <a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a> 会把年份设在<q>这个月</q><q>去年的下个月</q>之间。例如,若今天是 2001-06-08 ,那年份会设在 2001-06-30 到 2000-07-01 之间。我原则上赞成这样。不过,若你的 <span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 记录档超过一年整理归档,不要跑 <samp xml:lang="en">arclog</samp> ,否则记录档会大乱。</p></li>
<li><p>从标准输入读记录档,请注意下列事项:</p>
<ol>
<li><p>若要读标准输入,就一定要设定归档时,档名的开头,不然不知道怎么归档后要存到哪里去。</p></li>
<li><p>标准输入无法删除、归零或保留部份内容。若要读标准输入,原档保留模式会自动退回成全部保留。一次读入多档时,若其中有标准输入,会一律退回全部保留,以避免混乱。</p></li>
<li><p><samp xml:lang="en">ask</samp> 模式的回答也是从标准输入读的。因为标准输入只有一个,所以从标准输入读档时,无法跑 <samp xml:lang="en">ask</samp> 模式,会自动退回到 <samp xml:lang="en">fail</samp> 模式。</p></li>
</ol>
</li>
<li><p>我建议安装 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a> ,尽量不要用 <samp xml:lang="en">file</samp> 程式。 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a> 内建的档案类型表好像比 <samp xml:lang="en">file</samp> 程式准确。若不是 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 压缩档, <samp xml:lang="en">arclog</samp> 会把视为当成纯文字档。若压缩档被误判为图档, <samp xml:lang="en">arclog</samp> 会当成纯文字档,直接读记录,并以错误结束。就算错误也不会弄乱原记录档,不过多少有点麻烦。</p></li>
</ul>
<h2>系统需求</h2>
<ol>
<li><p><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 5.8.0 以上。 <samp xml:lang="en">arclog</samp> 用三个参数的 <samp xml:lang="en">open()</samp> 来复制档案操作,我还不知道怎么改写到更早的版本上执行。若你可以改写到更早的版本上执行,请告诉我。你可以输入 <q xml:lang="en"><samp>perl -v</samp></q> 查询你目前的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 版本。如果你没有 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 或需要升级,可以到 <a href="http://www.perl.com/" hreflang="en"><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 网站</a>下载安装最新版 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 。若你是用 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> ,可以到 <a href="http://www.activestate.com/" hreflang="en"><span xml:lang="en">ActiveState</span> 公司</a>下载 <span xml:lang="en">ActivePerl</span> 安装。</p></li>
<li><p>需搭配的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 模组:</p>
<dl>
<dt><a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a></dt>
<dd>
<p>这是辨识记录时间用的。你可以<a href="http://search.cpan.org/dist/TimeDate/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模组库下载安装 <samp xml:lang="en">Date::Parse</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpan Date::Parse</samp></q> 安装,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpanp i Date::Parse</samp></q> 安装。若你是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>apt-get install libtimedate-perl</samp></q> 安装。若你是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>yum install perl-TimeDate</samp></q> 安装。若你是 <span xml:lang="en">FreeBSD</span> 使用者,可以执行 <q xml:lang="en"><samp>ports install p5-TimeDate</samp></q> 安装。若你是 <span xml:lang="en">ActivePerl</span> 使用者,可以执行 <q xml:lang="en"><samp>ppm install Date::Parse</samp></q> 安装。</p>
</dd>
</dl>
</li>
<li><p>选配的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 模组:</p>
<dl>
<dt><a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a></dt>
<dd>
<p>这是检查档案类型用的。若没有安装, <samp xml:lang="en">arclog</samp> 会找 <samp xml:lang="en">file</samp> 程式代替。若还找不到, <samp xml:lang="en">arclog</samp> 会改用档尾(副档名)判断档案类型。这时若从标准输入读档, <samp xml:lang="en">arclog</samp> 就无法判断了。你可以<a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模组库下载安装 <samp xml:lang="en">File::MMagic</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpan File::MMagic</samp></q> 安装,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpanp i File::MMagic</samp></q> 安装。若你是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>apt-get install libfile-mmagic-perl</samp></q> 安装。若你是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>yum install perl-File-MMagic</samp></q> 安装。若你是 <span xml:lang="en">FreeBSD</span> 使用者,可以执行 <q xml:lang="en"><samp>ports install p5-File-MMagic</samp></q> 安装。若你是 <span xml:lang="en">ActivePerl</span> 使用者,可以执行 <q xml:lang="en"><samp>ppm install File::MMagic</samp></q> 安装。若你要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">file.exe</samp> 程式,可以由 <a href="http://gnuwin32.sourceforge.net/" hreflang="en-us"><span xml:lang="en">GnuWin32</span> 网站</a>下载。请确认下载后,存档在系统的路径下,档名为 <samp xml:lang="en">file.exe</samp></p>
<p>建议用 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a><samp xml:lang="en">file</samp> 程式偶尔会误判。</p>
</dd>
<dt><a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a></dt>
<dd>
<p>这是处理 <samp xml:lang="en">gzip</samp> 压缩档用的,只有在处理 <samp xml:lang="en">gzip</samp> 压缩档才会用到。若要用时没有安装, <samp xml:lang="en">arclog</samp> 会试著改用 <samp xml:lang="en">gzip</samp> 程式代替。若还找不到, <samp xml:lang="en">arclog</samp> 就无法执行。你可以<a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模组库下载安装 <samp xml:lang="en">Compress::Zlib</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpan Compress::Zlib</samp></q> 安装,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpanp i Compress::Zlib</samp></q> 安装。若你是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>apt-get install libcompress-zlib-perl</samp></q> 安装。若你是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>yum install perl-Compress-Zlib</samp></q> 安装。若你是 <span xml:lang="en">FreeBSD</span> 使用者,可以执行 <q xml:lang="en"><samp>ports install p5-Compress-Zlib</samp></q> 安装。若你是 <span xml:lang="en">ActivePerl</span> 使用者,可以执行 <q xml:lang="en"><samp>ppm install Compress::Zlib</samp></q> 安装。若你要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">gzip.exe</samp> 程式,可以由 <a href="http://www.gzip.org/" hreflang="en"><samp xml:lang="en">gzip</samp> 网站</a>下载。请确认下载后,存档在系统的路径下,档名为 <samp xml:lang="en">gzip.exe</samp></p>
</dd>
<dt><a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> 第二版以上</dt>
<dd>
<p>这是处理 <samp xml:lang="en">bzip2</samp> 压缩档用的,只有在处理 <samp xml:lang="en">bzip2</samp> 压缩档才会用到。若要用时没有安装, <samp xml:lang="en">arclog</samp> 会试著改用 <samp xml:lang="en">bzip2</samp> 程式代替。若还找不到, <samp xml:lang="en">arclog</samp> 就无法执行。你可以<a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模组库下载安装 <samp xml:lang="en">Compress::Bzip2</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpan Compress::Bzip2</samp></q> 安装,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpanp i Compress::Bzip2</samp></q> 安装。若你是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>apt-get install libcompress-bzip2-perl</samp></q> 安装。若你是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>yum install perl-Compress-Bzip2</samp></q> 安装。若你是 <span xml:lang="en">FreeBSD</span> 使用者,可以执行 <q xml:lang="en"><samp>ports install p5-Compress-Bzip2</samp></q> 安装。若你是 <span xml:lang="en">ActivePerl</span> 使用者,可以执行 <q xml:lang="en"><samp>ppm install Compress::Bzip2</samp></q> 安装。若你要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">bzip2.exe</samp> 程式,可以由 <a href="http://www.bzip.org/" hreflang="en"><samp xml:lang="en">bzip2</samp> 网站</a>下载。请确认下载后,存档在系统的路径下,档名为 <samp xml:lang="en">bzip2.exe</samp></p>
</dd>
<dt><a href="http://search.cpan.org/dist/TermReadKey/" hreflang="en" xml:lang="en"><samp>Term::ReadKey</samp></a></dt>
<dd>
<p>这是显示进度列用的,若没有安装,就不会显示进度列。此外不会有任何问题。进度列可以让你对 <samp xml:lang="en">arclog</samp> 的工作进度一目了然。你可以<a href="http://search.cpan.org/dist/TermReadKey/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模组库下载安装 <samp xml:lang="en">Term::ReadKey</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpan Term::ReadKey</samp></q> 安装,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 执行 <q xml:lang="en"><samp>cpanp i Term::ReadKey</samp></q> 安装。若你是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>apt-get install libterm-readkey-perl</samp></q> 安装。若你是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以执行 <q xml:lang="en"><samp>yum install perl-TermReadKey</samp></q> 安装。若你是 <span xml:lang="en">FreeBSD</span> 使用者,可以执行 <q xml:lang="en"><samp>ports install p5-Term-ReadKey</samp></q> 安装。若你是 <span xml:lang="en">ActivePerl</span> 使用者,可以执行 <q xml:lang="en"><samp>ppm install Term::ReadKey</samp></q> 安装。</p>
</dd>
</dl>
</li>
</ol>
<h2>下载</h2>
<p><samp xml:lang="en">arclog</samp> 的官方网站在:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><span xml:lang="en">SourceForge</span> 上的 <samp xml:lang="en">arclog</samp> 网站。</a></p></li>
<li><p><a href="https://sourceforge.net/projects/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 专案页。</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 专案页。</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html">旅舍依玛 <samp xml:lang="en">arclog</samp> 网页</a></p></li>
</ul>
<p>最新版 <samp xml:lang="en">arclog</samp> 可由下列位址下载:</p>
<ul>
<li><p><a href="https://sourceforge.net/project/showfiles.php?group_id=62499" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 下载页。</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 专案页。</a></p></li>
<li><p><a href="ftp://ftp.imacat.idv.tw/pub/arclog/">旅舍依玛 <abbr title="File Transfer Protocol" xml:lang="en">FTP</abbr> 站。</a></p></li>
</ul>
<p>依玛猫的 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公钥在:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/pgpkey.asc"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 网站上的依玛猫 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公钥。</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/me/pgpkey.asc">旅舍依玛上的依玛猫 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公钥。</a></p></li>
</ul>
<h2>安装</h2>
<p>若你是由 <samp xml:lang="en">arclog.pl</samp> 2.1.1dev4 以前的版本升级,请参阅 <samp xml:lang="en">UPGRADE.zh-cn</samp> 档的升级说明。</p>
<h3><a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 安装</h3>
<p><samp xml:lang="en">arclog</samp><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 标准的 <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 安装,程序如下:</p>
<blockquote xml:lang="en"><pre>
% perl Makefile.PL
% make
% make test
% make install
</pre></blockquote>
<p><q xml:lang="en"><samp>make install</samp></q> 前,请先确认你有在安装目录存档的权限。通常这时候要切换为 <samp xml:lang="en">root</samp> ,才能安装存档。</p>
<p>若你是用 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下的 <span xml:lang="en">ActivePerl</span> <samp xml:lang="en">make</samp> 请改用 <samp xml:lang="en">nmake</samp><a href="ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe" type="application/x-dosexec"><samp xml:lang="en">nmake</samp> 可由微软的 <abbr title="File Transfer Protocol" xml:lang="en">FTP</abbr> 站下载</a></p>
<p>若要安装到其它地方,请设定好 <samp xml:lang="en">PREFIX</samp> 。例如,一般使用者,要安装在自己的目录下时:</p>
<blockquote xml:lang="en"><pre>
% perl Makefile.PL PREFIX=/home/jessica
</pre></blockquote>
<p>要知道更多安装选项的细节,请参阅 <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 的说明(请执行 <q xml:lang="en"><samp>perldoc ExtUtils::MakeMaker</samp></q> )。</p>
<h3><a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 安装</h3>
<p>若你喜欢,也可以用 <a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 安装,程序如下:</p>
<blockquote xml:lang="en"><pre>
% perl Build.PL
% ./Build
% ./Build test
% ./Build install
</pre></blockquote>
<p><q xml:lang="en"><samp>./Build install</samp></q> 前,请先确认你有在安装目录存档的权限。通常这时候要切换为 <samp xml:lang="en">root</samp> ,才能安装存档。</p>
<p>若要安装到其它地方,请设定好 <samp xml:lang="en">--prefix</samp> 。例如,一般使用者,要安装在自己的目录下时:</p>
<blockquote><pre xml:lang="en">
% perl Build.PL --prefix=/home/jessica
</pre></blockquote>
<p>要知道更多安装选项的细节,请参阅 <a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 的说明(请执行 <q xml:lang="en"><samp>perldoc Module::Build</samp></q> )。</p>
<h2>命令列参数</h2>
<pre>
./arclog [参数] 记录档档名&hellip; [归档档名开头]
./arclog [-h|-v]
</pre>
<dl>
<dt xml:lang="en"><var xml:lang="zh-cn">记录档档名</var></dt>
<dd>
<p>要整理归档的记录档档名。若要从标准输入读记录档,请设定成 <q><samp>-</samp></q> 。可同时指定许多档案。支援 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 压缩档。</p>
</dd>
<dt xml:lang="en"><var xml:lang="zh-cn">归档档名开头</var></dt>
<dd>
<p>归档档名用的开头,归档后的档案会取名叫<q><samp>开头.yymmdd</samp></q>,如:<samp>开头.200101</samp><samp>开头.200102</samp> &hellip;等。如果没有设定,会用记录档的档名当开头。若你要从标准输入读记录档,就一定要设归档档名开头。这里不能用 <q><samp>-</samp></q> (标准输入),因为这里设定的是档名的开头,不是档名。</p>
</dd>
<dt xml:lang="en">-c, --compress <var xml:lang="zh-cn">压缩法</var></dt>
<dd>
<p>设定归档用的压缩法。记录大多都长得很像,压缩掉会省下非常多的空间。(不然干嘛归档? ^_*&rsquo; )目前支援下列的压缩法:</p>
<dl>
<dt xml:lang="en">g, gzip</dt>
<dd>
<p><samp xml:lang="en">gzip</samp> 压缩。预设是用 <samp xml:lang="en">gzip</samp> 压缩。 <samp xml:lang="en">arclog</samp> 可以用 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> 来代替 <samp xml:lang="en">gzip</samp> 压缩,不用呼叫外部程式,比较快比较安全。不过如果你没有装 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> <samp xml:lang="en">arclog</samp> 还是会自己改用 <samp xml:lang="en">gzip</samp> 程式压缩。但如果连 <samp xml:lang="en">gzip</samp> 程式都没有,却要用到 <samp xml:lang="en">gzip</samp> 压缩,就没有办法了,无法执行。</p>
</dd>
<dt xml:lang="en">b, bzip2</dt>
<dd>
<p><samp xml:lang="en">bzip2</samp> 压缩。 <samp xml:lang="en">arclog</samp> 可以用 <a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> 来代替 <samp xml:lang="en">bzip2</samp> 压缩,不用呼叫外部程式,比较快比较安全。不过如果你没有装 <a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> <samp xml:lang="en">arclog</samp> 还是会自己改用 <samp xml:lang="en">bzip2</samp> 程式压缩。但如果连 <samp xml:lang="en">bzip2</samp> 程式都没有,却要用到 <samp xml:lang="en">bzip2</samp> 压缩,就没有办法了,无法执行。</p>
</dd>
<dt xml:lang="en">n, none</dt>
<dd>
<p>不要压缩。(你没搞错吧? :p </p>
</dd>
</dl>
</dd>
<dt xml:lang="en">--nocompress</dt>
<dd>
<p>归档后不要压缩,效果和 <q xml:lang="en"><samp>--compress none</samp></q> 一样。</p>
</dd>
<dt xml:lang="en">-s, --sort</dt>
<dd>
<p>按记录时间先后(及记录本身顺序)排序。排序很耗记忆体和 <abbr title="central processing unit" xml:lang="en">CPU</abbr> ,所以预设是不排序。请参见前面关於排序的注意事项。</p>
</dd>
<dt xml:lang="en">--nosort</dt>
<dd>
<p>不要排序(预设值)。</p>
</dd>
<dt xml:lang="en">-o, --override <var xml:lang="zh-cn">模式</var></dt>
<dd>
<p>如果有同名的旧档,该怎么办。目前有下列模式:</p>
<dl>
<dt xml:lang="en">o, overwrite</dt>
<dd>
<p>盖掉旧档。旧档的记录会被删掉,请多加小心。若你的记录档是主记录档,有最完整的记录,你可以用 <samp xml:lang="en">overwrite</samp></p>
</dd>
<dt xml:lang="en">a, append</dt>
<dd>
<p>和旧档加在一起。这有可能会演变成大混乱,请多加小心。若你想把两份不同时间的记录档加在一起,你可以用 <samp xml:lang="en">append</samp></p>
</dd>
<dt xml:lang="en">i, ignore</dt>
<dd>
<p>略过所有该月的记录。这有可能造成部份记录流失,请多加小心。若你只要补充没有归档的月份,你可以用 <samp xml:lang="en">ignore</samp></p>
</dd>
<dt xml:lang="en">f, fail</dt>
<dd>
<p>结束程式,以免不小心破坏旧档。若你要用 <samp xml:lang="en">crontab</samp> 之类的程式,全自动化执行,最好这样,以免破坏资料。因此,若标准输入不是连到键盘上,预设是 <samp xml:lang="en">fail</samp></p>
</dd>
<dt xml:lang="en">ask</dt>
<dd>
<p>问你该怎么办。若你是手动执行,这样最方便。因此,若标准输入是连到键盘上,预设是 <samp xml:lang="en">ask</samp> 。答案是从标准输入读的。因为标准输入只有一个,若你要从标准输入读记录档,不能跑 <samp xml:lang="en">ask</samp> 模式,会自动退回 <samp xml:lang="en">fail</samp> 模式。还有,如果从标准输入读不到东西,像 <samp xml:lang="en">crontab</samp> 里标准输入被关掉了,也会自动退回 <samp xml:lang="en">fail</samp> 模式。</p>
</dd>
</dl>
</dd>
<dt xml:lang="en">-k, --keep <var xml:lang="zh-cn">模式</var></dt>
<dd>
<p>原记录档要怎么处理。目前有下列模式:</p>
<dl>
<dt xml:lang="en">a, all</dt>
<dd>
<p>完全保留原档。</p>
</dd>
<dt xml:lang="en">r, restart</dt>
<dd>
<p>归档后,原记录档归零。</p>
</dd>
<dt xml:lang="en">d, delete</dt>
<dd>
<p>归档后,删除原记录档。</p>
</dd>
<dt xml:lang="en">t, this-month</dt>
<dd>
<p>将之前月份的记录归档,保留这个月的记录,留待下个月归档。这是给 <samp xml:lang="en">crontab</samp> 每月归档用的。因此,预设是 <samp xml:lang="en">this-month</samp></p>
</dd>
</dl>
</dd>
<dt xml:lang="en">-d, --debug</dt>
<dd>
<p>显示详细的执行过程。</p>
</dd>
<dt xml:lang="en">-q, --quiet</dt>
<dd>
<p>没事不要吵。 :p</p>
</dd>
<dt xml:lang="en">-h, --help</dt>
<dd>
<p>显示程式说明。</p>
</dd>
<dt xml:lang="en">-v, --version</dt>
<dd>
<p>显示程式版本。</p>
</dd>
</dl>
<h2>版权声明</h2>
<p>版权所有 &copy; 2001-2007 依玛猫。</p>
<p>本程式是自由软体,您可以遵照自由软体基金会 <span xml:lang="en">(Free Software Foundation)</span> 出版的 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共许可证</cite>条款 <span xml:lang="en">(<cite><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> General Public License</cite>)</span> 第三版来修改和重新发布这一程式,或者自由选择使用任何更新的版本。</p>
<p>发布这一程式的目的是希望它有用,但没有任何担保。甚至没有适合特定目的而隐含的担保。更详细的情况请参阅 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共许可证</cite></p>
<p>您应该已经和程式一起收到一份 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共许可证</cite>的副本。如果还没有,参阅<samp>&lt;<a href="http://www.gnu.org/licenses/" hreflang="en">http://www.gnu.org/licenses/</a>&gt;</samp></p>
<h2>版本纪录</h2>
<p>请阅读 <samp xml:lang="en">NEWS</samp> 档,查看程式的演变、新增的功能和修补的错误。</p>
<h2>支援协助</h2>
<p><samp xml:lang="en">arclog</samp> 网站架在 <a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a><a href="http://www.cpan.org/" hreflang="en" xml:lang="en"><acronym title="Comprehensive Perl Archive Network">CPAN</acronym></a><a href="http://www.imacat.idv.tw/">旅舍依玛</a>。索取最新资讯,请驾临:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><span xml:lang="en">SourceForge</span> 上的 <samp xml:lang="en">arclog</samp> 网站</a></p></li>
<li><p><a href="http://sourceforge.net/projects/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 专案页</a></p></li>
<li><p><a href="http://search.cpan.org/dist/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 专案页</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html">旅舍依玛 <samp xml:lang="en">arclog</samp> 网页</a></p></li>
</ul>
<p><a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a> 上有一个 <a href="mailto:arclog-users&#64;lists.sourceforge.net"><samp xml:lang="en">arclog</samp> 的邮件通讯</a> 。使用上的问题、建议或错误回报,请提到通讯上讨论。它是 <a href="http://www.list.org/" hreflang="en" xml:lang="en">Mailman</a> 的邮件通讯。若要加入,请到 <a href="https://lists.sourceforge.net/lists/listinfo/arclog-users" hreflang="en"><samp xml:lang="en">arclog</samp> 邮件通讯的网页</a> 。你也可以写信到 <a href="mailto:arclog-users-request&#64;lists.sourceforge.net"><acronym title="electronic mail" xml:lang="en">E-mail</acronym> 指令信箱</a>,标题填上 <samp xml:lang="en">help</samp> ,索取 <acronym title="electronic mail" xml:lang="en">E-mail</acronym> 指令说明。</p>
</div>
<hr />
<div id="footer" class="footer" title="页尾区">
<address><a href="mailto:imacat&#64;mail.imacat.idv.tw">依玛猫</a>,初稿 2001-06-08 ,上次更新日期 2008-11-15</address>
<address>版权所有 &copy; 2010 依玛猫,欲转载引用请先阅读<a href="fdl.txt">版权声明</a></address>
</div>
</body>
</html>

518
mpresent.zh-tw.html Normal file
View File

@ -0,0 +1,518 @@
<?xml version="1.0" encoding="Big5" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-tw">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="author" content="依瑪貓" />
<meta name="copyright" content="&copy; 2010 依瑪貓。" />
<meta name="keywords" content="整理, Apache, Syslog, 記錄檔" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.zh-cn.html"
hreflang="zh-cn" title="简体中文" />
<link rel="alternate" type="application/xhtml+xml" href="mpresent.en.html"
hreflang="en-us" title="English" />
<link rel="copyright" type="text/plain" href="fdl.txt" />
<link rel="author" href="mailto:imacat&#64;mail.imacat.idv.tw" />
<style type="text/css">
h2, em {
text-transform: uppercase;
}
.accessguide {
font-size: 0.5em;
float: left;
width: 0.5em;
}
q {
quotes: "「" "」" "『" "』";
}
q:lang(en) {
quotes: "\201C" "\201D" "\2018" "\2019";
}
cite {
quotes: "《" "》";
}
</style>
<title>mpresent 0.01 版</title>
</head>
<body>
<div class="langs" title="語言切換區">
<span>正體中文</span> |
<span xml:lang="zh-cn"><a href="mpresent.zh-cn.html"
title="切换到本页的简体中文版。"
hreflang="zh-cn">简体中文</a></span> |
<span xml:lang="en"><a href="mpresent.en.html"
title="Switch to the English version of this page."
hreflang="en-us">English</a></span>
</div>
<hr />
<div id="body" class="body" title="網頁內文區">
<div class="accessguide"><a accesskey="C"
href="#body" title="網頁內文區">:::</a></div>
<h1><samp xml:lang="en">mpresent</samp> 0.01 版</h1>
<h2>最新消息</h2>
<dl>
<dt>2007-12-03</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 0.01 。說明文件修正。若妳之前安裝了 <samp xml:lang="en">arclog</samp> 3.00 版或之後的版本,不需要昇級新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-0.01.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog</samp> 0.01 版</a></p>
</dd>
<dt>2007-12-03</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.03 。修正測試套件。所需 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 版本號碼改用相容於舊版的號碼格式,以消除 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 5.10 的警告訊息。若妳之前安裝了 <samp xml:lang="en">arclog</samp> 3.00 版或之後的版本,不需要昇級新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.03.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog</samp> 3.03 版</a></p>
</dd>
<dt>2007-11-30</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.02 。修正測試套件,以處理日光節約時間問題。若妳之前安裝了 <samp xml:lang="en">arclog</samp> 3.00 版或之後的版本,不需要昇級新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.02.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog</samp> 3.02 版</a></p>
</dd>
<dt>2007-11-28</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.01 。修正測試套件,以協助釐清 <abbr title="Comprehensive Perl Archive Network">CPAN</abbr> 測試回報的錯誤。若妳之前安裝了 <samp xml:lang="en">arclog</samp> 3.00 版,不需要昇級新版。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.01.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog</samp> 3.01 版</a></p>
</dd>
<dt>2007-11-28</dt>
<dd>
<p><samp xml:lang="en">arclog</samp> 最新版本 3.00 。從 <a href="http://www.imacat.idv.tw/tech/reslog.html"><samp xml:lang="en">reslog</samp></a> 借過來的全新程式碼,檔名也從 <samp xml:lang="en">arclog.pl</samp> 改為 <samp xml:lang="en">arclog</samp> 。新的物件導向處理器,可順利處理各種壓縮法及檔案格式。安裝系統由 <a href="http://www.gnu.org/software/autoconf/"><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> <samp>autoconf</samp></a> 改用 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym><a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><samp>ExtUtils::MakeMaker</samp></a><a href="http://search.cpan.org/dist/Module-Build/"><samp>Module::Build</samp></a> 。新加上完整的測試套件,協助程式品管。版權更新為 <a href="http://www.gnu.org/licenses/gpl-3.0.html" hreflang="en" xml:lang="en"><abbr title="GNU General Public License version 3" xml:lang="en">GPLv3</abbr></a><a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog-3.00.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog</samp> 3.00 版</a></p>
</dd>
<dt>2002-09-26</dt>
<dd>
<p><samp xml:lang="en">arclog.pl</samp> 最新版本 2.1.0 。這是 2.1.0 的最終版,加上了 <samp xml:lang="en">bzip2</samp> 壓縮的支援,用 <samp xml:lang="en">gzip</samp> 程式代替 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> 壓縮,並改用 <a href="http://www.gnu.org/software/autoconf/" hreflang="en" xml:lang="en"><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> <samp>autoconf</samp></a> 安裝設定程式。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog.pl-2.1.0.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog.pl</samp> 2.1.0</a></p>
</dd>
<dt>2002-09-18</dt>
<dd>
<p><samp xml:lang="en">arclog.pl</samp> 最新版本 2.1.0dev2 。本版修正了幾個說明文件的錯誤,並把 <a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a> 加進 <samp xml:lang="en">arclog.pl</samp> 的下載網址中。妳可以把它當做<q>申請 <span xml:lang="en">SourceForge</span> 紀念版</q>。原則上,不需要急著昇級。<a href="ftp://ftp.imacat.idv.tw/pub/arclog/arclog.pl-2.1.0dev2.tar.gz" type="application/x-gzip">下載 <samp xml:lang="en">arclog.pl</samp> 2.1.0dev2</a></p>
</dd>
<dt>2002-09-17</dt>
<dd>
<p>好消息! <samp xml:lang="en">arclog.pl</samp> 已開始架設於 <a href="https://sourceforge.net/projects/arclog/" xml:lang="en">SourceForge</a> 囉!(雖然我幾乎還完全搞不清楚要怎麼架…摸索中… ^^; </p>
</dd>
</dl>
<h2>說明</h2>
<p><dfn xml:lang="en"><samp>arclog</samp></dfn> 是記錄檔每月歸檔程式,將記錄檔中,前月的記錄按月份壓縮歸檔,以節省硬碟空間,並避免記錄檔被有心人士破壞。</p>
<p><samp xml:lang="en">arclog</samp> 目前支援 <a href="http://httpd.apache.org/" hreflang="en" xml:lang="en">Apache</a><span xml:lang="en">Syslog</span><a href="http://www.ntp.org/" hreflang="en" xml:lang="en"><abbr title="network time protocol">NTP</abbr></a><span xml:lang="en">Apache 1 <abbr title="secure socket layer">SSL</abbr> engine log</span> 及我自己用的括弧 <acronym title="International Organization for Standardization" xml:lang="en">ISO</acronym> 修正格式五種格式的記錄檔,與 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 兩種壓縮法。很多程式都可以用 <span xml:lang="en">Apache</span> 相容記錄檔格式記錄,如 <a href="http://www.cups.org/" hreflang="en" xml:lang="en"><abbr title="Common UNIX Printing System">CUPS</abbr></a><a href="http://www.proftpd.org/" hreflang="en" xml:lang="en">ProFTPD</a><a href="http://www.pureftpd.org/" hreflang="en" xml:lang="en">Pure-FTPd</a>&hellip;等, <samp xml:lang="en">arclog</samp> 也可以歸檔這些 <span xml:lang="en">Apache</span> 相容格式的記錄檔。</p>
<h2>注意事項</h2>
<ul>
<li><p>歸類記錄檔<em>很耗時間</em>。為減少佔用原記錄檔的時間, <samp xml:lang="en">arclog</samp> 會先把原記錄檔複製到暫時工作檔,視需要把原記錄檔歸零,再慢慢在暫時工作檔上作業。不過仍請注意下列事項:</p>
<ol>
<li><p>如果原記錄檔很大(好幾百 <abbr title="megabyte" xml:lang="en">MB</abbr> ),光複製檔案就很花時間了。這種情況下,最好先關閉記錄程式,等整理完以後,再繼續記錄,以避免記錄錯亂。若平常有定期歸檔,記錄檔就不會無限制膨脹了。</p></li>
<li><p><samp xml:lang="en">arclog</samp> 執行到一半因故中斷,會留下殘存的暫時工作檔。日後 <samp xml:lang="en">arclog</samp> 執行時,碰到之前殘存的暫時工作檔,會停止執行。要先處理掉之前的暫時工作檔,才能繼續。暫時工作檔只是原檔的複本,只要改個檔名再歸檔一次,就可以了。</p></li>
</ol>
</li>
<li><p>沒有特別理由,最好不要排序。排序的潛在問題如下:</p>
<ol>
<li><p>記錄檔很大時,排序<em>會吃掉很多記憶體</em>。所需記憶體依歸檔後每個月記錄筆數而定。新版的 <span xml:lang="en">Linux</span><span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 系統有記憶體耗用保護,會中斷吃掉太多記憶體的程式,不過這還是要花好幾分鐘,這幾分鐘內系統會完全當掉不動。我不知道別的作業系統有沒有記憶體耗用保護。如果妳要玩,風險自負。</p></li>
<li><p>所有支援的記錄檔格式,時間最小單位為<em><q></q></em>。同一秒內的記錄會先以記錄檔順序(若同時歸檔好幾個記錄檔),再以記錄本身出現的次序排序。這樣設計儘可能讓排序歸檔後同一秒內的記錄次序,和事件真正的發生順序一致,但也無法完全保證。若同一秒內的事件次序很重要,妳要自行小心。</p></li>
</ol>
</li>
<li><p>歸檔 <span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 記錄檔時,請特別注意: <em><span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 記錄檔沒有記年。</em> <samp xml:lang="en">arclog</samp><a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a> 模組解讀時間。無年份時, <a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a> 會把年份設在<q>這個月</q><q>去年的下個月</q>之間。例如,若今天是 2001-06-08 ,那年份會設在 2001-06-30 到 2000-07-01 之間。我原則上贊成這樣。不過,若妳的 <span xml:lang="en">Syslog</span><abbr title="network time protocol" xml:lang="en">NTP</abbr> 記錄檔超過一年整理歸檔,不要跑 <samp xml:lang="en">arclog</samp> ,否則記錄檔會大亂。</p></li>
<li><p>從標準輸入讀記錄檔,請注意下列事項:</p>
<ol>
<li><p>若要讀標準輸入,就一定要設定歸檔時,檔名的開頭,不然不知道怎麼歸檔後要存到哪裏去。</p></li>
<li><p>標準輸入無法刪除、歸零或保留部份內容。若要讀標準輸入,原檔保留模式會自動退回成全部保留。一次讀入多檔時,若其中有標準輸入,會一律退回全部保留,以避免混亂。</p></li>
<li><p><samp xml:lang="en">ask</samp> 模式的回答也是從標準輸入讀的。因為標準輸入只有一個,所以從標準輸入讀檔時,無法跑 <samp xml:lang="en">ask</samp> 模式,會自動退回到 <samp xml:lang="en">fail</samp> 模式。</p></li>
</ol>
</li>
<li><p>我建議安裝 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a> ,儘量不要用 <samp xml:lang="en">file</samp> 程式。 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a> 內建的檔案類型表好像比 <samp xml:lang="en">file</samp> 程式準確。若不是 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 壓縮檔, <samp xml:lang="en">arclog</samp> 會把視為當成純文字檔。若壓縮檔被誤判為圖檔, <samp xml:lang="en">arclog</samp> 會當成純文字檔,直接讀記錄,並以錯誤結束。就算錯誤也不會弄亂原記錄檔,不過多少有點麻煩。</p></li>
</ul>
<h2>系統需求</h2>
<ol>
<li><p><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 5.8.0 以上。 <samp xml:lang="en">arclog</samp> 用三個參數的 <samp xml:lang="en">open()</samp> 來複製檔案操作,我還不知道怎麼改寫到更早的版本上執行。若妳可以改寫到更早的版本上執行,請告訴我。妳可以輸入 <q xml:lang="en"><samp>perl -v</samp></q> 查詢妳目前的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 版本。如果妳沒有 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 或需要昇級,可以到 <a href="http://www.perl.com/" hreflang="en"><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 網站</a>下載安裝最新版 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 。若妳是用 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> ,可以到 <a href="http://www.activestate.com/" hreflang="en"><span xml:lang="en">ActiveState</span> 公司</a>下載 <span xml:lang="en">ActivePerl</span> 安裝。</p></li>
<li><p>需搭配的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 模組:</p>
<dl>
<dt><a href="http://search.cpan.org/dist/TimeDate/" hreflang="en" xml:lang="en"><samp>Date::Parse</samp></a></dt>
<dd>
<p>這是辨識記錄時間用的。妳可以<a href="http://search.cpan.org/dist/TimeDate/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模組庫下載安裝 <samp xml:lang="en">Date::Parse</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpan Date::Parse</samp></q> 安裝,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpanp i Date::Parse</samp></q> 安裝。若妳是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>apt-get install libtimedate-perl</samp></q> 安裝。若妳是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>yum install perl-TimeDate</samp></q> 安裝。若妳是 <span xml:lang="en">FreeBSD</span> 使用者,可以執行 <q xml:lang="en"><samp>ports install p5-TimeDate</samp></q> 安裝。若妳是 <span xml:lang="en">ActivePerl</span> 使用者,可以執行 <q xml:lang="en"><samp>ppm install Date::Parse</samp></q> 安裝。</p>
</dd>
</dl>
<p>若妳由 <samp xml:lang="en">CPAN</samp><span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 安裝 <samp xml:lang="en">arclog</samp> ,會自動幫妳安裝以上所需的模組。</p>
</li>
<li><p>選配的 <acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 模組:</p>
<dl>
<dt><a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a></dt>
<dd>
<p>這是檢查檔案類型用的。若沒有安裝, <samp xml:lang="en">arclog</samp> 會找 <samp xml:lang="en">file</samp> 程式代替。若還找不到, <samp xml:lang="en">arclog</samp> 會改用檔尾(副檔名)判斷檔案類型。這時若從標準輸入讀檔, <samp xml:lang="en">arclog</samp> 就無法判斷了。妳可以<a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模組庫下載安裝 <samp xml:lang="en">File::MMagic</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpan File::MMagic</samp></q> 安裝,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpanp i File::MMagic</samp></q> 安裝。若妳是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>apt-get install libfile-mmagic-perl</samp></q> 安裝。若妳是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>yum install perl-File-MMagic</samp></q> 安裝。若妳是 <span xml:lang="en">FreeBSD</span> 使用者,可以執行 <q xml:lang="en"><samp>ports install p5-File-MMagic</samp></q> 安裝。若妳是 <span xml:lang="en">ActivePerl</span> 使用者,可以執行 <q xml:lang="en"><samp>ppm install File::MMagic</samp></q> 安裝。若妳要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">file.exe</samp> 程式,可以由 <a href="http://gnuwin32.sourceforge.net/" hreflang="en-us"><span xml:lang="en">GnuWin32</span> 網站</a>下載。請確認下載後,存檔在系統的路徑下,檔名為 <samp xml:lang="en">file.exe</samp></p>
<p>建議用 <a href="http://search.cpan.org/dist/File-MMagic/" hreflang="en" xml:lang="en"><samp>File::MMagic</samp></a><samp xml:lang="en">file</samp> 程式偶爾會誤判。</p>
</dd>
<dt><a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a></dt>
<dd>
<p>這是處理 <samp xml:lang="en">gzip</samp> 壓縮檔用的,只有在處理 <samp xml:lang="en">gzip</samp> 壓縮檔才會用到。若要用時沒有安裝, <samp xml:lang="en">arclog</samp> 會試著改用 <samp xml:lang="en">gzip</samp> 程式代替。若還找不到, <samp xml:lang="en">arclog</samp> 就無法執行。妳可以<a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模組庫下載安裝 <samp xml:lang="en">Compress::Zlib</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpan Compress::Zlib</samp></q> 安裝,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpanp i Compress::Zlib</samp></q> 安裝。若妳是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>apt-get install libcompress-zlib-perl</samp></q> 安裝。若妳是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>yum install perl-Compress-Zlib</samp></q> 安裝。若妳是 <span xml:lang="en">FreeBSD</span> 使用者,可以執行 <q xml:lang="en"><samp>ports install p5-Compress-Zlib</samp></q> 安裝。若妳是 <span xml:lang="en">ActivePerl</span> 使用者,可以執行 <q xml:lang="en"><samp>ppm install Compress::Zlib</samp></q> 安裝。若妳要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">gzip.exe</samp> 程式,可以由 <a href="http://www.gzip.org/" hreflang="en"><samp xml:lang="en">gzip</samp> 網站</a>下載。請確認下載後,存檔在系統的路徑下,檔名為 <samp xml:lang="en">gzip.exe</samp></p>
</dd>
<dt><a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> 第二版以上</dt>
<dd>
<p>這是處理 <samp xml:lang="en">bzip2</samp> 壓縮檔用的,只有在處理 <samp xml:lang="en">bzip2</samp> 壓縮檔才會用到。若要用時沒有安裝, <samp xml:lang="en">arclog</samp> 會試著改用 <samp xml:lang="en">bzip2</samp> 程式代替。若還找不到, <samp xml:lang="en">arclog</samp> 就無法執行。妳可以<a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模組庫下載安裝 <samp xml:lang="en">Compress::Bzip2</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpan Compress::Bzip2</samp></q> 安裝,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpanp i Compress::Bzip2</samp></q> 安裝。若妳是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>apt-get install libcompress-bzip2-perl</samp></q> 安裝。若妳是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>yum install perl-Compress-Bzip2</samp></q> 安裝。若妳是 <span xml:lang="en">FreeBSD</span> 使用者,可以執行 <q xml:lang="en"><samp>ports install p5-Compress-Bzip2</samp></q> 安裝。若妳是 <span xml:lang="en">ActivePerl</span> 使用者,可以執行 <q xml:lang="en"><samp>ppm install Compress::Bzip2</samp></q> 安裝。若妳要在 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下使用 <samp xml:lang="en">bzip2.exe</samp> 程式,可以由 <a href="http://www.bzip.org/" hreflang="en"><samp xml:lang="en">bzip2</samp> 網站</a>下載。請確認下載後,存檔在系統的路徑下,檔名為 <samp xml:lang="en">bzip2.exe</samp></p>
</dd>
<dt><a href="http://search.cpan.org/dist/TermReadKey/" hreflang="en" xml:lang="en"><samp>Term::ReadKey</samp></a></dt>
<dd>
<p>這是顯示進度列用的,若沒有安裝,就不會顯示進度列。此外不會有任何問題。進度列可以讓妳對 <samp xml:lang="en">arclog</samp> 的工作進度一目瞭然。妳可以<a href="http://search.cpan.org/dist/TermReadKey/" hreflang="en"><acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 模組庫下載安裝 <samp xml:lang="en">Term::ReadKey</samp> </a>,或用 <span xml:lang="en"><samp>CPAN</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpan Term::ReadKey</samp></q> 安裝,或用 <span xml:lang="en"><samp>CPANPLUS</samp> Shell</span> 執行 <q xml:lang="en"><samp>cpanp i Term::ReadKey</samp></q> 安裝。若妳是 <span xml:lang="en">Debian/Ubandu Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>apt-get install libterm-readkey-perl</samp></q> 安裝。若妳是 <span xml:lang="en">Red Hat/Fedora/CentOS Linux</span> 使用者,可以執行 <q xml:lang="en"><samp>yum install perl-TermReadKey</samp></q> 安裝。若妳是 <span xml:lang="en">FreeBSD</span> 使用者,可以執行 <q xml:lang="en"><samp>ports install p5-Term-ReadKey</samp></q> 安裝。若妳是 <span xml:lang="en">ActivePerl</span> 使用者,可以執行 <q xml:lang="en"><samp>ppm install Term::ReadKey</samp></q> 安裝。</p>
</dd>
</dl>
</li>
</ol>
<h2>下載</h2>
<p><samp xml:lang="en">arclog</samp> 的官方網站在:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><span xml:lang="en">SourceForge</span> 上的 <samp xml:lang="en">arclog</samp> 網站。</a></p></li>
<li><p><a href="https://sourceforge.net/projects/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 專案頁。</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 專案頁。</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html">旅舍依瑪 <samp xml:lang="en">arclog</samp> 網頁</a></p></li>
</ul>
<p>最新版 <samp xml:lang="en">arclog</samp> 可由下列位址下載:</p>
<ul>
<li><p><a href="https://sourceforge.net/project/showfiles.php?group_id=62499" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 下載頁。</a></p></li>
<li><p><a href="http://search.cpan.org/~imacat/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 專案頁。</a></p></li>
<li><p><a href="ftp://ftp.imacat.idv.tw/pub/arclog/">旅舍依瑪 <abbr title="File Transfer Protocol" xml:lang="en">FTP</abbr> 站。</a></p></li>
</ul>
<p>依瑪貓的 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公鑰在:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/pgpkey.asc"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 網站上的依瑪貓 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公鑰。</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/me/pgpkey.asc">旅舍依瑪上的依瑪貓 <abbr title="Pretty Good Privacy" xml:lang="en">PGP</abbr> 公鑰。</a></p></li>
</ul>
<h2>安裝</h2>
<p>若妳是由 <samp xml:lang="en">arclog.pl</samp> 2.1.1dev4 以前的版本昇級,請參閱 <samp xml:lang="en">UPGRADE.zh-tw</samp> 檔的昇級說明。</p>
<h3><a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 安裝</h3>
<p><samp xml:lang="en">arclog</samp><acronym title="Practical Extraction and Reporting Language" xml:lang="en">Perl</acronym> 標準的 <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 安裝,程序如下:</p>
<blockquote xml:lang="en"><pre>
% perl Makefile.PL
% make
% make test
% make install
</pre></blockquote>
<p><q xml:lang="en"><samp>make install</samp></q> 前,請先確認妳有在安裝目錄存檔的權限。通常這時候要切換為 <samp xml:lang="en">root</samp> ,才能安裝存檔。</p>
<p>若妳是用 <span xml:lang="en"><abbr title="Microsoft">MS</abbr>-Windows</span> 下的 <span xml:lang="en">ActivePerl</span> <samp xml:lang="en">make</samp> 請改用 <samp xml:lang="en">nmake</samp><a href="ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe" type="application/x-dosexec"><samp xml:lang="en">nmake</samp> 可由微軟的 <abbr title="File Transfer Protocol" xml:lang="en">FTP</abbr> 站下載</a></p>
<p>若要安裝到其它地方,請設定好 <samp xml:lang="en">PREFIX</samp> 。例如,一般使用者,要安裝在自己的目錄下時:</p>
<blockquote xml:lang="en"><pre>
% perl Makefile.PL PREFIX=/home/jessica
</pre></blockquote>
<p>要知道更多安裝選項的細節,請參閱 <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/" hreflang="en" xml:lang="en"><samp>ExtUtils::MakeMaker</samp></a> 的說明(請執行 <q xml:lang="en"><samp>perldoc ExtUtils::MakeMaker</samp></q> )。</p>
<h3><a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 安裝</h3>
<p>若妳喜歡,也可以用 <a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 安裝,程序如下:</p>
<blockquote xml:lang="en"><pre>
% perl Build.PL
% ./Build
% ./Build test
% ./Build install
</pre></blockquote>
<p><q xml:lang="en"><samp>./Build install</samp></q> 前,請先確認妳有在安裝目錄存檔的權限。通常這時候要切換為 <samp xml:lang="en">root</samp> ,才能安裝存檔。</p>
<p>若要安裝到其它地方,請設定好 <samp xml:lang="en">--prefix</samp> 。例如,一般使用者,要安裝在自己的目錄下時:</p>
<blockquote><pre xml:lang="en">
% perl Build.PL --prefix=/home/jessica
</pre></blockquote>
<p>要知道更多安裝選項的細節,請參閱 <a href="http://search.cpan.org/dist/Module-Build/" hreflang="en" xml:lang="en"><samp>Module::Build</samp></a> 的說明(請執行 <q xml:lang="en"><samp>perldoc Module::Build</samp></q> )。</p>
<h2>命令列參數</h2>
<pre>
./arclog [參數] 記錄檔檔名&hellip; [歸檔檔名開頭]
./arclog [-h|-v]
</pre>
<dl>
<dt xml:lang="en"><var xml:lang="zh-tw">記錄檔檔名</var></dt>
<dd>
<p>要整理歸檔的記錄檔檔名。若要從標準輸入讀記錄檔,請設定成 <q><samp>-</samp></q> 。可同時指定許多檔案。支援 <samp xml:lang="en">gzip</samp><samp xml:lang="en">bzip2</samp> 壓縮檔。</p>
</dd>
<dt xml:lang="en"><var xml:lang="zh-tw">歸檔檔名開頭</var></dt>
<dd>
<p>歸檔檔名用的開頭,歸檔後的檔案會取名叫<q><samp>開頭.yymmdd</samp></q>,如:<samp>開頭.200101</samp><samp>開頭.200102</samp> &hellip;等。如果沒有設定,會用記錄檔的檔名當開頭。若妳要從標準輸入讀記錄檔,就一定要設歸檔檔名開頭。這裏不能用 <q><samp>-</samp></q> (標準輸入),因為這裏設定的是檔名的開頭,不是檔名。</p>
</dd>
<dt xml:lang="en">-c, --compress <var xml:lang="zh-tw">壓縮法</var></dt>
<dd>
<p>設定歸檔用的壓縮法。記錄大多都長得很像,壓縮掉會省下非常多的空間。(不然幹嘛歸檔? ^_*&rsquo; )目前支援下列的壓縮法:</p>
<dl>
<dt xml:lang="en">g, gzip</dt>
<dd>
<p><samp xml:lang="en">gzip</samp> 壓縮。預設是用 <samp xml:lang="en">gzip</samp> 壓縮。 <samp xml:lang="en">arclog</samp> 可以用 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> 來代替 <samp xml:lang="en">gzip</samp> 壓縮,不用呼叫外部程式,比較快比較安全。不過如果妳沒有裝 <a href="http://search.cpan.org/dist/Compress-Zlib/" hreflang="en" xml:lang="en"><samp>Compress::Zlib</samp></a> <samp xml:lang="en">arclog</samp> 還是會自己改用 <samp xml:lang="en">gzip</samp> 程式壓縮。但如果連 <samp xml:lang="en">gzip</samp> 程式都沒有,卻要用到 <samp xml:lang="en">gzip</samp> 壓縮,就沒有辦法了,無法執行。</p>
</dd>
<dt xml:lang="en">b, bzip2</dt>
<dd>
<p><samp xml:lang="en">bzip2</samp> 壓縮。 <samp xml:lang="en">arclog</samp> 可以用 <a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> 來代替 <samp xml:lang="en">bzip2</samp> 壓縮,不用呼叫外部程式,比較快比較安全。不過如果妳沒有裝 <a href="http://search.cpan.org/dist/Compress-Bzip2/" hreflang="en" xml:lang="en"><samp>Compress::Bzip2</samp></a> <samp xml:lang="en">arclog</samp> 還是會自己改用 <samp xml:lang="en">bzip2</samp> 程式壓縮。但如果連 <samp xml:lang="en">bzip2</samp> 程式都沒有,卻要用到 <samp xml:lang="en">bzip2</samp> 壓縮,就沒有辦法了,無法執行。</p>
</dd>
<dt xml:lang="en">n, none</dt>
<dd>
<p>不要壓縮。(妳沒搞錯吧? :p </p>
</dd>
</dl>
</dd>
<dt xml:lang="en">--nocompress</dt>
<dd>
<p>歸檔後不要壓縮,效果和 <q xml:lang="en"><samp>--compress none</samp></q> 一樣。</p>
</dd>
<dt xml:lang="en">-s, --sort</dt>
<dd>
<p>按記錄時間先後(及記錄本身順序)排序。排序很耗記憶體和 <abbr title="central processing unit" xml:lang="en">CPU</abbr> ,所以預設是不排序。請參見前面關於排序的注意事項。</p>
</dd>
<dt xml:lang="en">--nosort</dt>
<dd>
<p>不要排序(預設值)。</p>
</dd>
<dt xml:lang="en">-o, --override <var xml:lang="zh-tw">模式</var></dt>
<dd>
<p>如果有同名的舊檔,該怎麼辦。目前有下列模式:</p>
<dl>
<dt xml:lang="en">o, overwrite</dt>
<dd>
<p>蓋掉舊檔。舊檔的記錄會被刪掉,請多加小心。若妳的記錄檔是主記錄檔,有最完整的記錄,妳可以用 <samp xml:lang="en">overwrite</samp></p>
</dd>
<dt xml:lang="en">a, append</dt>
<dd>
<p>和舊檔加在一起。這有可能會演變成大混亂,請多加小心。若妳想把兩份不同時間的記錄檔加在一起,妳可以用 <samp xml:lang="en">append</samp></p>
</dd>
<dt xml:lang="en">i, ignore</dt>
<dd>
<p>略過所有該月的記錄。這有可能造成部份記錄流失,請多加小心。若妳只要補充沒有歸檔的月份,妳可以用 <samp xml:lang="en">ignore</samp></p>
</dd>
<dt xml:lang="en">f, fail</dt>
<dd>
<p>結束程式,以免不小心破壞舊檔。若妳要用 <samp xml:lang="en">crontab</samp> 之類的程式,全自動化執行,最好這樣,以免破壞資料。因此,若標準輸入不是連到鍵盤上,預設是 <samp xml:lang="en">fail</samp></p>
</dd>
<dt xml:lang="en">ask</dt>
<dd>
<p>問妳該怎麼辦。若妳是手動執行,這樣最方便。因此,若標準輸入是連到鍵盤上,預設是 <samp xml:lang="en">ask</samp> 。答案是從標準輸入讀的。因為標準輸入只有一個,若妳要從標準輸入讀記錄檔,不能跑 <samp xml:lang="en">ask</samp> 模式,會自動退回 <samp xml:lang="en">fail</samp> 模式。還有,如果從標準輸入讀不到東西,像 <samp xml:lang="en">crontab</samp> 裏標準輸入被關掉了,也會自動退回 <samp xml:lang="en">fail</samp> 模式。</p>
</dd>
</dl>
</dd>
<dt xml:lang="en">-k, --keep <var xml:lang="zh-tw">模式</var></dt>
<dd>
<p>原記錄檔要怎麼處理。目前有下列模式:</p>
<dl>
<dt xml:lang="en">a, all</dt>
<dd>
<p>完全保留原檔。</p>
</dd>
<dt xml:lang="en">r, restart</dt>
<dd>
<p>歸檔後,原記錄檔歸零。</p>
</dd>
<dt xml:lang="en">d, delete</dt>
<dd>
<p>歸檔後,刪除原記錄檔。</p>
</dd>
<dt xml:lang="en">t, this-month</dt>
<dd>
<p>將之前月份的記錄歸檔,保留這個月的記錄,留待下個月歸檔。這是給 <samp xml:lang="en">crontab</samp> 每月歸檔用的。因此,預設是 <samp xml:lang="en">this-month</samp></p>
</dd>
</dl>
</dd>
<dt xml:lang="en">-d, --debug</dt>
<dd>
<p>顯示詳細的執行過程。</p>
</dd>
<dt xml:lang="en">-q, --quiet</dt>
<dd>
<p>沒事不要吵。 :p</p>
</dd>
<dt xml:lang="en">-h, --help</dt>
<dd>
<p>顯示程式說明。</p>
</dd>
<dt xml:lang="en">-v, --version</dt>
<dd>
<p>顯示程式版本。</p>
</dd>
</dl>
<h2>版權聲明</h2>
<p>版權所有 &copy; 2001-2007 依瑪貓。</p>
<p>本程式是自由軟體,您可以遵照自由軟體基金會 <span xml:lang="en">(Free Software Foundation)</span> 出版的 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共許可證</cite>條款 <span xml:lang="en">(<cite><acronym title="GNU&rsquo;s Not UNIX">GNU</acronym> General Public License</cite>)</span> 第三版來修改和重新發佈這一程式,或者自由選擇使用任何更新的版本。</p>
<p>發佈這一程式的目的是希望它有用,但沒有任何擔保。甚至沒有適合特定目的而隱含的擔保。更詳細的情況請參閱 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共許可證</cite></p>
<p>您應該已經和程式一起收到一份 <cite><acronym title="GNU&rsquo;s Not UNIX" xml:lang="en">GNU</acronym> 通用公共許可證</cite>的副本。如果還沒有,參閱<samp>&lt;<a href="http://www.gnu.org/licenses/" hreflang="en">http://www.gnu.org/licenses/</a>&gt;</samp></p>
<h2>版本紀錄</h2>
<p>請閱讀 <samp xml:lang="en">NEWS</samp> 檔,查看程式的演變、新增的功能和修補的錯誤。</p>
<h2>支援協助</h2>
<p><samp xml:lang="en">arclog</samp> 網站架在 <a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a><a href="http://www.cpan.org/" hreflang="en" xml:lang="en"><acronym title="Comprehensive Perl Archive Network">CPAN</acronym></a><a href="http://www.imacat.idv.tw/">旅舍依瑪</a>。索取最新資訊,請駕臨:</p>
<ul>
<li><p><a href="http://arclog.sourceforge.net/"><span xml:lang="en">SourceForge</span> 上的 <samp xml:lang="en">arclog</samp> 網站</a></p></li>
<li><p><a href="http://sourceforge.net/projects/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <span xml:lang="en">SourceForge</span> 專案頁</a></p></li>
<li><p><a href="http://search.cpan.org/dist/arclog/" hreflang="en"><samp xml:lang="en">arclog</samp> <acronym title="Comprehensive Perl Archive Network" xml:lang="en">CPAN</acronym> 專案頁</a></p></li>
<li><p><a href="http://www.imacat.idv.tw/tech/arclog.html">旅舍依瑪 <samp xml:lang="en">arclog</samp> 網頁</a></p></li>
</ul>
<p><a href="https://sourceforge.net/" hreflang="en" xml:lang="en">SourceForge</a> 上有一個 <a href="mailto:arclog-users&#64;lists.sourceforge.net"><samp xml:lang="en">arclog</samp> 的郵件通訊</a> 。使用上的問題、建議或錯誤回報,請提到通訊上討論。它是 <a href="http://www.list.org/" hreflang="en" xml:lang="en">Mailman</a> 的郵件通訊。若要加入,請到 <a href="https://lists.sourceforge.net/lists/listinfo/arclog-users" hreflang="en"><samp xml:lang="en">arclog</samp> 郵件通訊的網頁</a> 。妳也可以寫信到 <a href="mailto:arclog-users-request&#64;lists.sourceforge.net"><acronym title="electronic mail" xml:lang="en">E-mail</acronym> 指令信箱</a>,標題填上 <samp xml:lang="en">help</samp> ,索取 <acronym title="electronic mail" xml:lang="en">E-mail</acronym> 指令說明。</p>
</div>
<hr />
<div id="footer" class="footer" title="頁尾區">
<address><a href="mailto:imacat&#64;mail.imacat.idv.tw">依瑪貓</a>,初稿 2001-06-08 ,上次更新日期 2008-11-15</address>
<address>版權所有 &copy; 2010 依瑪貓,欲轉載引用請先閱讀<a href="fdl.txt">版權聲明</a></address>
</div>
</body>
</html>