[gopher] Item Type Questions
Matt Owen (Jaruzel)
jaruzel at jaruzel.com
Mon Oct 23 11:28:54 UTC 2017
In article <osdpsq$e4a$1 at blaine.gmane.org>, keiyakins-
Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org says...
>1. Is item type 3 supposed to be interpreted as a link, or text like i?
Item type 3 is an error, it's down to you how to display it, in "Gopher
Browser for Windows", I chose to display it simply as a text line in the
menu window, but with an error icon on the left hand side.
FYI, the full list of item types I have in my design notes are:
'FileTypes:
'A_TEXT = '0'
'A_MENU = '1'
'A_CSO = '2'
'A_ERROR = '3'
'A_MACBINHEX = '4'
'A_PCBINHEX = '5'
'A_UUENCODED = '6'
'A_INDEX = '7'
'A_TELNET = '8'
'A_BINARY = '9'
'A_DUPLICATE = '+'
'A_SOUND = 's'
'A_EVENT = 'e'
'A_CALENDAR = 'c'
'A_HTML = 'h'
'A_TN3270 = 'T'
'A_MIME = 'M'
'A_IMAGE = 'I'
'A_WHOIS = 'w'
'A_QUERY = 'q'
'A_GIF = 'g'
'A_HTML = 'h' # HTML file
'A_WWW = 'w' # WWW address
'A_PLUS_IMAGE = ':'
'A_PLUS_MOVIE = ';'
'A_PLUS_SOUND = '<'
>2. What is actually the difference between 5 ('dos file') and 9 ('binary
>file')? Is it just a vague hint on what the binary might be used for?
>3. Are there any item types other than i, h, and the ones in RFC1436 in
>common use I should be aware of?
Gopher Browser for Windows (GBfW) treats the following as a 'binary'. i.e.
it downloads as a file and then displays the item using the appropriate
viewer:
"g", "I", "p", "d", "M", "s", "h", ":", ";", "<"
Because it's a Windows app, it then does some funny stuff to intelligently
display the item:
1. If the downloaded file does not have a file extension, GBfW opens the
first 100 bytes of the file, and tries to identify the file type from the
first few bytes ('GIF8', "JFIF","PNG" etc.)
2. If it does have a file extension GBfW just uses that.
3. Once GBfW knows the file format, if it's an image or text document,
GBfW uses it's internal viewers, if it's something else, GBfW gets Windows
to open the file using the default application for the filetype (if there
is one)
4. Failing all that, GBfW just asks the user for a save location for the
file.
I did find during my testing that a lot of the running gopher servers are
very lax with their filetype assignments, so also had to code for various
incorrectly formatted or assigned filetypes.
-Matt
More information about the Gopher-Project
mailing list