home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Elite Hackers Toolkit
/
TheEliteHackersToolkitVolume1_1998.rar
/
HACKERS.BIN
/
appcraks
/
SPLITUPC.ZIP
/
SPLITUPC.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1998-01-26
|
6KB
|
171 lines
program splitupc; {kudut@mystics.bungi.com ver 1 apr 15, 1993}
{ver 2 jan 26, 1998}
{purpose: splits uupc/extended-type mailbox into files
of sequentially-numbered filenames, for use
with the news portion of the waffle.
{UPDATE JAN 1998 Re-writing program to
1) work with UUPC (20 ^A's and a linefeed) and
2) work with Waffle under these new conditions:
a) Creating old Waf 1.64 mailbox-style
instead of Newsgroup style.
PURPOSE: To facilitate (hopefully) importing
of UUPC mailbox-style into Waffle style
mailboxes 2.00
I'm going to try it reading line by line
to speed up process for UUPC mailbox
iT WORKS! iT WORKS!}
uses dos;
var
ch : string;
f,g : text;
end_of_message : boolean;
filename : string;
filenumber : integer; {which number we're at when creating new filenames}
function IntToStr(i: Longint): string;
{ Convert any Integer type to a string }
var
s: string;
begin
Str(i, s);
IntToStr := s;
end;
function FileExists(FileName: STRING)
: Boolean;
{ Returns True IF file exists; otherwise,
it returns False. }
VAR
f : file;
BEGIN
{$I-}
ASSIGN(f, FileName);
RESET(f);
CLOSE(f);
{$I+}
FileExists := (IOResult = 0) and
(FileName <> '');
END; { FileExists }
procedure Read_And_Write_New_Files;
var i : integer;
begin
i := 0;
(* reads in for the twenty control-a's *)
begin
readln(f,ch);
if ch = ''
then end;
if eof(f) then exit;
repeat
end_of_message := FALSE;
readln(f,ch);
if ch = '' then begin
end_of_message := TRUE;
exit;
end
else
write ('#'); {progress indicator}
writeln(g,ch);
until (eof(f)) or (end_of_message = TRUE);
end;
(* Dispersion of Wisdom is always a good thing *)
procedure fun_error_message;
const number_of_quotes = 20;
begin
randomize;
case random(number_of_quotes) of
0 : write('Be quick to take advantage of an advantage. - ');
1 : write('Trust in God but lock your car. - ');
2 : write('Never miss an opportunity to sleep in a screened-in porch. - ');
3 : writeln('Wear a shirt and tie to every interview - even for a job packing crates. --> ');
4 : write('When you go to borrow money, dress as if you have plenty of it. - ');
5 : write('Never apologize for being early for an appointment. - ');
6 : write('Accept a breath mint if someone offers you one. - ');
7 : write('Love deeply and passionately. You may get hurt, but it''s the only way to live life completely. --> ');
8 : write('Never laugh at anybody''s dreams. - ');
9 : writeln('Don''t be surprised to discover that luck favors those who are prepared. --> ');
10: writeln('Make allowances for your friends'' imperfections as easily you do your own. -> ');
11: writeln('Smile when picking up the phone. The caller will hear it in your voice. --> ');
12: writeln('Write a short note inside the cover, when giving a book as a gift. --> ');
13: write('Be the first to fight for a just cause. - ');
14: writeln('Every so often, invite the person behind you in line to go in front. --> ');
15: write('Give people more than they expect and do it cheerfully. - ');
16: write('Don''t overlook life''s small joys when seeking the big ones. - ');
17: write('Talk slow but think quick. - ');
18: write('When you lose, don''t lose the lesson. - ');
19: write('Stop and watch stonemasons at work. - ');
20: write('Remember that a good example is the best sermon. - ');
end;
end;
begin
(* GLOAT SECTION *)
writeln('SplitUPC 2.00 by Kenneth Udut');
writeln;
writeln(' Takes UUPC/Extended-Style Mailbox, where each message is separated by a set of');
writeln(' 20 Control-A''s, and spits out each message into a separate file, named');
writeln(' 1, 2, 3, 4, etc. Created for the use of easily porting mailboxes to a');
writeln(' format that Waffle Newsreaders like.');
writeln;
writeln(' +-----------------------------+');
writeln(' | Usage: SPLITUPC mailbox.spb |');
writeln(' +-----------------------------+');
writeln;
writeln(' kudut@mystics.bungi.com');
(* Check Whether or not specified filename (MAILBOX.F) for example, exists *)
filename := paramstr(1);
while not FileExists(filename) do
begin
fun_error_message;
write('Filename: ');
readln(filename);
end;
(* Now that the file exists, open up the file and start processing *)
assign(f,filename);
reset(f);
readln(f,ch); {reading into the first message helps the problem of skipped first message}
filenumber := 1;
end_of_message := TRUE;
(* Progresses filenumber plus one, or skips if the file exists already *)
repeat
while fileexists(IntToStr(filenumber)) do filenumber := filenumber + 1;
assign(g, IntToStr(filenumber));
rewrite(g);
writeln;
write(filenumber,' ');
Read_And_Write_New_Files;
close(g);
until eof(f);
close(f);
writeln;
fun_error_message;
end.