home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
ctf112.zip
/
HURL.MEX
< prev
next >
Wrap
Text File
|
1996-01-02
|
2KB
|
89 lines
// Hurl.mex
//
// Written by Craig Allsop
// White Lightning @ 3:640/225
// Created: 2-1-96
//
// Extended hurl command, will hurl all tagged files into another area.
//
#include <max.mh>
#include <max_menu.mh>
int main()
{
int: qsize, fnum, flags, pos;
long: fsize;
struct _stamp: fdate;
string: filename, rootname;
char: nonstop;
qsize := tag_queue_size();
print(COL_WHITE "\nYou have ", qsize, " files tagged. ");
if (qsize and strlen(input)=0)
{
int: len;
string: entry;
len:=input_str( entry, INPUT_WORD|INPUT_NOLF, 0, 12, "Hurl to? " );
if (len)
{
print('\n');
nonstop := False;
for ( fnum := 0; fnum < qsize AND do_more(nonstop, COL_CYAN); fnum := fnum + 1 )
{
tag_get_name( fnum, flags, filename );
// We need to strip off the path name for display
pos := strridx(filename, 0, '\\');
if (pos=0)
rootname := filename;
else rootname := substr(filename, pos+1, strlen(filename)-pos+1);
print(COL_YELLOW, strpad(rootname,13,' '), ' ');
fsize := filesize(filename);
// Now display the file details
if (fsize=-1)
{
// Dequeue it if it isn't there...
print(COL_WHITE, "** file no longer exists and has been dequeued **\n");
tag_dequeue_file(fnum);
fnum := fnum - 1;
qsize := tag_queue_size();
}
else
{
// Otherwise, tell the user the size & date
print(COL_MAGENTA, strpadleft(ltostr(fsize shr 10),5,' '), "k ", COL_CYAN);
input:=input+rootname+";"+entry+";";
menu_cmd(MNU_FILE_HURL,"");
tag_dequeue_file(fnum);
fnum := fnum - 1;
qsize := tag_queue_size();
}
}
print('\n');
}
}
else
{
print('\n');
menu_cmd(MNU_FILE_HURL,"");
}
return 0;
}