home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
OS2
/
GPHER161.ZIP
/
GETFNAME.GPH
next >
Wrap
Text File
|
1994-02-09
|
1KB
|
36 lines
/* Return a reasonable filename */
Parse arg type plustype, host, port, title, selstr, candidate, reason
/* Parse the candidate file into directory and file: */
candidate = translate(candidate,'/','\')
last = lastpos('/', candidate)
if last > 0 then
do
last = last + 1
parse var candidate path =(last) tail
end
else
do
path = ''
tail = candidate
end
/* Now, parse the selection string into directory and file. */
selstr = translate(selstr, '/', '\:')
last = lastpos('/', selstr)
selstr = substr(selstr, last+1)
/* If we're being called to advise the user, build a candidate
filename from the path and the selection string. Note that
there's no guarantee that the resulting filename is actually
valid -- for example, on a FAT system, it should be constrained
to 8.3 format, and it's not. */
if (reason='PROMPT') then
return path || selstr
/* If we're being called for a GIF file, always use the same
filename. */
if (type = 'g') then
return path || 'work.gif'