home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
comm
/
fido
/
spot
/
rexx
/
filehatch.spot
< prev
next >
Wrap
Text File
|
1993-12-21
|
11KB
|
305 lines
/***************************************************************************/
/* */
/* FileHatch.spot ©1993 Stefan Zeiger 2:244/6302.15@fidonet */
/* */
/* $VER: FileHatch.spot 1.5 (24.9.93) */
/* */
/* [Based roughly on SkyHatch.spot by Stu Churchill] */
/* */
/* This script will hatch a file using FHatch or SkyTick and post an */
/* announcement in the appropriate area. */
/* */
/* Yes! Hatching a file is really *that* easy! ;) */
/* */
/***************************************************************************/
/* */
/* Instructions: - Install FTick/FHatch or SkyTick, if you haven't done */
/* this already. */
/* */
/* - Modify the settings below. All variables' meanings */
/* should be quite obvious */
/* */
/* - Add FileHatch.spot in Spot's ARexx menu or start it */
/* directly via rx. */
/* */
/* - Have fun with this script! ;) */
/* */
/***************************************************************************/
/* */
/* 20.09.1993 1.0 First release */
/* 21.09.1993 1.1 Largely enhanced */
/* 24.09.1993 1.2 Hatched file is now copied with 'clone' */
/* 1.3 FileHatch can now use both FHatch and SkyTick */
/* 1.4 Generic list requester procedures added */
/* 25.09.1993 1.5 Bugs fixed */
/* */
/***************************************************************************/
fhatch_path = 'mail:bin/FHatch'
ftick_cfg = 'mail:tick.cfg'
skytick_path = 'mail:skytick/SkyTick'
skytick_cfg = 'mail:sky' /* -> mail:skyTICK.CFG */
used_program = 'fhatch' /* [fhatch|skytick|none] */
from_name = 'Stefan Zeiger'
host_name = '2:244/6302.15'
to_name = 'All'
subj_line = 'File Arrival Announcement'
origin = 'FileHatch.spot, (c) 1993 by Stefan Zeiger'
use_origin = 'yes'
temp_file = 'T:FileHatch.spot.TMP'
temp_dir = 'T:'
spot_path = 'sys:comm/spot/Spot'
file_path = 'outgoing:'
keep_original = 'yes'
call newlist()
call addlist('SPOT_BETA')
call addlist('UPLOAD.ALLG')
call addlist('UPLOAD.AMIGA')
call addlist('UPLOAD.DTP')
call addlist('UPLOAD.MOD')
call addlist('UPLOAD.PIX')
call addlist('UPLOAD.RAY')
/***************************************************************************/
/* Set up system */
/***************************************************************************/
options results
CR = '0d'x
if ~show(l, 'rexxsupport.library') then do
if ~addlib('rexxsupport.library', 0, -30) then do
say 'Please install the rexxsupport.library in your libs: directory'
end
end
if ~show('ports','SPOT') then do
address command spot_path
'WaitForPort SPOT'
if rc = 5 then do
call cleanup()
end
quit = 'yes'
end
'isiconified'
if rc = 0 then do
icon = 'yes'
'uniconify'
end
/***************************************************************************/
/* Ask for the file, areas and description */
/***************************************************************************/
address spot
'requestfile title "Hatch file..." path 'file_path
if rc>0 then call cleanup()
hatchfile=result
filearea_name=picklist("Hatch in...")
if filearea_name='CANCELLED' then call cleanup()
if filearea_name='' then call cleanup()
'requestarea title "Announce in..."'
if rc>0 then call cleanup()
echo_name=result
address command
call statef(hatchfile)
parse var result dummy filelength dummy dummy dummy dummy dummy description
description=substr(description,2)
address spot
'requeststring title "Description..." prompt "Please enter the description" center default "'description'"'
if rc>0 then call cleanup()
description=result
/***************************************************************************/
/* Create the announcement */
/***************************************************************************/
address command
call delete(temp_file)
hatchdate=date()', 'time()
separator=lastpos('/',hatchfile)
if separator=0 then separator=lastpos(':',hatchfile)
if separator=0 then hatchfile_base=hatchfile
else hatchfile_base=substr(hatchfile,separator+1)
call open('TEMP',temp_file,'W')
call writeln('TEMP','')
call writeln('TEMP','')
call writeln('TEMP',' The following file has just been hatched at 'host_name' :')
call writeln('TEMP','')
call writeln('TEMP','')
call writeln('TEMP',' File name : 'hatchfile_base)
call writeln('TEMP',' Length : 'filelength)
call writeln('TEMP',' Description : 'description)
call writeln('TEMP',' File area : 'filearea_name)
call writeln('TEMP',' Origin : 'host_name)
call writeln('TEMP',' Date, Time : 'hatchdate)
call writeln('TEMP','')
call writeln('TEMP','')
call writeln('TEMP',' Information supplied by FileHatch.spot 1.5 (c) 1993 by Stefan Zeiger')
call writeln('TEMP','')
call close('TEMP')
/***************************************************************************/
/* Hatch the file */
/***************************************************************************/
select
when used_program='skytick' then call hatch_with_skytick()
when used_program='fhatch' then call hatch_with_fhatch()
otherwise nop
end
/***************************************************************************/
/* Write the file announcement message into the specified area */
/***************************************************************************/
address spot
'lockgui'
'arealist'
'gotoarea NAME 'echo_name
if rc ~= 0 then do
'requestnotify PROMPT "Could not find area'||CR||echo_name'"'
call cleanup()
end
'messagelist'
if use_origin='yes' then 'write TO "'to_name'" FROM "'from_name'" SUBJECT "'subj_line'" FILE 'temp_file' ORIGIN "'origin'" NOEDIT NOGUI NOSIG'
else 'write TO "'to_name'" FROM "'from_name'" SUBJECT "'subj_line'" FILE 'temp_file' NOEDIT NOGUI NOSIG'
'arealist'
'unlockgui'
/***************************************************************************/
/* Exit gracefully */
/***************************************************************************/
if icon = 'yes' then do
'iconify NOREQ'
end
if quit = 'yes' then do
'quitspot NOREQ'
end
call delete(temp_file)
call deletelist()
call cleanup()
/***************************************************************************/
/* Hatch the file using FHatch */
/***************************************************************************/
hatch_with_fhatch:
address command
if keep_original='yes' then 'copy 'hatchfile' to 'temp_dir||hatchfile_base' clone'
fhatch_path' "'ftick_cfg'" "'hatchfile'" 'filearea_nam