Received: with LISTAR (v1.0.0; list gopher); Fri, 15 Jun 2001 04:43:35 -0500 (EST) Return-Path: <98002519@si.hhs.nl> Delivered-To: gopher@complete.org Received: from planck (planck.hhs.nl [145.52.2.10]) by pi.glockenspiel.complete.org (Postfix) with ESMTP id 2D24E3B80B for ; Fri, 15 Jun 2001 04:43:34 -0500 (EST) Received: from paaltjens.si.hhs.nl ([145.52.89.11] helo=mail.si.hhs.nl) by planck with esmtp (Exim 3.13 #1) id 15Aq8N-0005xO-00 for gopher@complete.org; Fri, 15 Jun 2001 11:43:19 +0200 Received: from voeten ([145.52.90.54] helo=si.hhs.nl) by mail.si.hhs.nl with esmtp (Exim 3.22 #2) id 15Aq8M-0003Hk-00 for gopher@complete.org; Fri, 15 Jun 2001 11:43:18 +0200 Message-ID: <3B29D81F.654F3EA9@si.hhs.nl> Date: Fri, 15 Jun 2001 11:40:47 +0200 From: 98002519 <98002519@si.hhs.nl> Organization: Haagse Hogeschool Sector Informatica X-Mailer: Mozilla 4.61 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: gopher@complete.org Subject: [gopher] Getting file info from an URI?? Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-archive-position: 173 X-listar-version: Listar v1.0.0 Sender: gopher-bounce@complete.org Errors-to: gopher-bounce@complete.org X-original-sender: 98002519@si.hhs.nl Precedence: bulk Reply-to: gopher@complete.org List-help: List-unsubscribe: List-software: Listar version 1.0.0 X-List-ID: Gopher List-subscribe: List-owner: List-post: List-archive: X-list: gopher Hi Gopherers, As I've written not so long ago, I'm working on a Gopher method for the GNOME Virtual File System (gnome-vfs). The problem with gnome-vfs is that it works extensively with URI's. It is very common for a gnome-vfs method to be required to fetch file information (like mime-type) given _only_ an URI. Now the Gopher standard writes: "[t]he selector string should mean nothing to the client software; it should never be modified by the client." Now this implies three things: first, one _cannot_ determine a file type by looking at the format of an URI. Second, one _cannot_ assume that a Gopher selector is seperated by slashes. And third, even if one could do just that, one _cannot_ assume that a "parent directory" lists the child. Practical example: gopher.heatdeath.org uses selectors like "1/foo", but you can't just list the "1" directory to find the item "foo" there (try it; it doesn't work). So my question is: how _can_ I find the file information given only an URI? I figured out a few solutions, all with their own problems: 1) Use the Gopher+ "!" (information) selector feature Problem: requires Gopher+. Can one assume Gopher+ nowadays? Or are there still many "non-plus" Gopher servers around? Please comment on this. 2) Make a pool of recently downloaded directory listings from which one can search for the given selector and get the file description and type. Problem: when do you know a dirlisting can be deleted from the pool? I guess you can't be sure until the end of the session. 3) Download part of the file and "sniff" the mime type. Problem: that still doesn't give you a description (name) for the file, only the mime type. I'd fancy any of these solutions (or even another if there is one) if only I could solve their problems. I really wonder if one can assume the availability of Gopher+ nowadays. Gopher+ has a few advanced features that may be very useful in my implementation, and that would keep out "hacks" like 2) and 3). Yet I don't want sites to be inaccessible just because they don't use Gopher+. Maybe I'll have to work out 2 solutions, one for Gopher and one for Plus. Anyway, I'd like to hear your comments. Greets, Stefan