home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
compress
/
arjit.zip
/
ARJIT.CPP
next >
Wrap
C/C++ Source or Header
|
1993-07-13
|
3KB
|
86 lines
/*
ARJIT - a tool to work with the ARJ utility.
--------------------------------------------
Garry J. Vass
Gundhof Str 18
Frankfurt 60528
Germany
The purpose of this little hack is to compress all
the files in the current directory into an ARJ file.
The ARJ file will be given the same name as the directory.
Why? Because I frequently need to free up some disk space
for something, but I don't want to erase anything. Sure,
I can simply type the ARJ command line, but 1. I use this
tool in conjunction with "GO" and "SWEEP" (tools that
operate on an entire tree); and 2. I am VERY lazy.
To use this tool, go to a directory and type "ARJIT".
Note that you must have ARJ.EXE installed in your path.
To use this tool with "GO", type GO ARJIT. (etc).
ARJ is a compression utility written by Robert Jung,
and the word, "ARJ", is a registered trademark belonging
to him.
What lies below is the "C" language source code. You are
invited to hack away.
*/
/***************************************************************/
/* */
/* */
/* */
/* */
/***************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dir.h>
/***************************************************************/
/* */
/* */
/* */
/* */
/***************************************************************/
char Cmd[ 261 ];
char Basecwd[ 128 ];
char Target[ 128 ];
/***************************************************************/
/* */
/* */
/* */
/* */
/***************************************************************/
int main( int argc, char *argv[] )
{
char *arj = searchpath( "ARJ.EXE" );
if( !arj ) {
printf( "ARJ not found!\n" );
exit( 0 );
}
getcwd( Basecwd, 128 );
printf( "Current directory is %s\n", Basecwd );
strcpy( Target, Basecwd );
strrev( Target );
char *p = strchr( Target, '\\' );
if( p ) {
*p = 0;
}
strrev( Target );
sprintf( Cmd, "%s m %s *.*", arj, Target );
system( Cmd );
system( "DIR" );
return( 0 );
}
/***************************************************************/
/* */
/* */
/* */
/* */
/***************************************************************/