[tahoe-dev] wanted in webapi: a way to download a file only if it is a file

zooko zooko at zooko.com
Fri Aug 10 15:39:04 UTC 2007


> I think I'm
> invoking Zipf's Law here: the shortest command should be the most
> frequent one, in this case it's a question of what URL the human types
> into their browser and what they expect that URL to do. So GET of a  
> file
> gets the file, GET of a directory shows the directory in a
> browser-useful (ie HTML for humans) way.

I agree -- things that are For Human Use should be short and sweet.


As for programmatic use, there are three options:

1.  The current webapi.txt.  You and I agree that it isn't good  
enough because there isn't a deterministic way to know whether the  
thing that you were fetching was a file or a directory.

2.  Add a flag to mean "Get this if is a file, else return error.",  
and why not a flag that says "Get this if it is a directory, else  
return error.".

3.  Wouldn't it be nice if we could issue a GET, regardless of the  
file-or-directory type, and get back both the type and the contents?   
What about using the HTTP headers to indicate whether the data is  
file contents or a directory listing?

Your description of XML and XSLT is interesting.  I guess it would be  
a separate issue from file-or-directory type:

  * Wouldn't it be nice if we could issue a GET, regardless of the  
human-or-computer consumer, and get back both the human-readable and  
computer-readable contents.


So for right now (I want to release the allmydata.org Tahoe v0.5 as  
soon as possible!) we can definitely implement approach #2.  Could we  
implement approach #3?  How about if we add an X-Allmydata- 
FileOrDirectory header?

Regards,

Zooko




More information about the tahoe-dev mailing list