Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

v001SRC100: yankits -- Front End to "yankit" Utility (GNO)

5 views
Skip to first unread message

comp-sour...@pilot.njin.net

unread,
Feb 4, 1995, 9:33:51 PM2/4/95
to

Submitted-By: David Empson (dem...@actrix.gen.nz)
Posting-number: Volume 1, Source 100
Archive-Name: gno/util/archive/yankits
Architecture: 2gs
Version-Number: 1.00

Yankits is a simple utility for GNO which uses Andy McFadden's "yankit"
utility to list or extract all the files in a series of NuFX (ShrinkIt)
archives.

Enjoy.

********************************************************************************

=Manifest
-Manifest
-Read.Me
-yankits.c
=Read.Me
-
-Yankits
-
-Yankits is a simple utility for GNO which uses Andy McFadden's "yankit"
-utility to list or extract all the files in a series of NuFX (ShrinkIt)
-archives.
-
-For example, you can replace the lines:
- yankit xv archive_1
- yankit xv archive_2
- yankit xv archive_3
-with a single line using yankits:
- yankits xv archive_1 archive_2 archive_3
-
-==========
-Invocation
-==========
-The command line is similar to that of "yankit"; the same operation codes
-and options are supported, and multiple archive files may be specified.
-The wildcards "*" and "?" may be used since they are handled by the
-shell, and not by the yankit program.
-
-Yankits only allows you to extract every file in an archive; this limitation
-comes about because each command line argument is treated as an archive name.
-
-Usage:
- yankits <operation code> [<options>] <archive> [<archive>*]
-
-where <operation code> is one of:
- t Table of contents - list files in the archive
- x Extract files from the archive
- i Integrity check on the archive
-
-and <options> is one or more of:
- v Verbose mode - display more information
- f Force overwrite of existing files
- s Don't use GS/OS deferred write sessions
-
-Note that there must not be any spaces between the operation code and
-options. Thus the directive:
- tvs
-is legal, while the directive:
- t vs
-is not. In the latter case the "vs" will be treated as the name of
-the archive to extract from, and not as an option.
-
-Yankits does not interpret the operation code or options in any way;
-they are passed directly to yankit. More information on the operation
-code and options can be found in the yankit documentation.
-
-Consider the command line:
- yankits x /i/download/*.shk
-This silently extracts all files from all shrinkit archives in the
-/i/download directory (with each archive name ending in ".shk") to
-the current directory. If the files "first.shk", "second.shk" and
-"third.shk" were in the /i/download directory, this would be the
-equivalent of:
- yankit x /i/download/first.shk
- yankit x /i/download/second.shk
- yankit x /i/download/third.shk
-
-Note that the "*" is expanded by the shell, and not by yankits.
-
-==============
-Implementation
-==============
-Yankits works by invoking "/usr/bin/yankit" once for each archive
-specified on the command line. The same operation code is passed
-to each invocation of /usr/bin/yankit.
-
-=========
-Compiling
-=========
-Compiling yankits requires ORCA/C (I used version 2.0.3) and the GNO
-libraries. Compilation may be performed under GNO or ORCA/Shell.
-The program runs only under GNO.
-
-Compile the program uses:
- compile yankits.c keep=yankits
-
-This produces the object files "yankits.root" and "yankits.a". ORCA/C
-2.0 and later will also produce a yankits.sym file, containing the
-compiler symbol table.
-
-Linking the program uses:
- link yankits keep=yankits
-
-======
-Author
-======
-Yankits was written by David Empson (dem...@actrix.gen.nz).
-
-Yankits is public domain. The source code and executable may be freely
-distributed, modified, etc.
-
-David Empson
-dem...@actrix.gen.nz
-P.O. Box 27-103
-Wellington, New Zealand
-Version 1.00
-February, 1995
=yankits.c
-
-#pragma stacksize 512
-
-#include <stdio.h>
-#include <string.h>
-#include <gno/gno.h>
-
-char cmdline[65];
-
-void doyankit(void) {
- execve("/usr/bin/yankit", cmdline);
-}
-
-int main(int argc, char **argv) {
- int pid, baselen;
- if (!needsgno()) {
- puts("This program requires GNO.");
- return -1;
- }
- if (argc < 3) {
- puts("YANKITS 1.0 by David Empson (dem...@actrix.gen.nz), Freeware");
- puts("");
- puts("Usage: yankits t[vfs]|x[vfs]|i[vfs] file.shk...");
- puts("");
- puts("Process multiple archive files with yankit.");
- puts("Only entire archives may be extracted.");
- return -1;
- }
- strcpy(cmdline, "yankit ");
- strcpy(cmdline + 7, argv[1]);
- baselen = strlen(cmdline);
- cmdline[baselen++] = ' ';
- for (argv += 2, --argc; --argc; ++argv) {
- strcpy(cmdline + baselen, *argv);
- pid = fork(doyankit);
- wait(NULL);
- }
- return 0;
-}
-
+ END OF ARCHIVE

0 new messages