Changes between Version 13 and Version 14 of Extensions
- Timestamp:
- 2010-04-04T15:41:02Z (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Extensions
v13 v14 16 16 Tahoe URIs may refer to either immutable or mutable content. URIs for immutable data are simple to cache by mapping the URI to the contents. 17 17 18 Mutability is independent of read-only capabilities. A read-only capabilitymay refer to mutable content (i.e. *you* can't write to it, but somebody else might be able to).18 A read-only capability is not necessarily immutable. It may refer to mutable content (i.e. *you* can't write to it, but somebody else might be able to). 19 19 20 20 To determine the mutability of a URI, parse the second field of the URI (delimited by ':'): 21 21 22 * URI:CHK:... : immutable 23 * URI:LIT:... : immutable 24 * URI:SSK:... : mutable, writable 25 * URI:SSK-RO:... : mutable, not writable 26 * URI:DIR:... : mutable, writable 27 * URI:DIR-RO:... : mutable, not writable 22 * URI:CHK:... : immutable 23 * URI:LIT:... : immutable 24 * URI:SSK:... : mutable, writable 25 * URI:SSK-RO:... : mutable, not writable 26 * URI:DIR-CHK:... : immutable 27 * URI:DIR-LIT:... : immutable 28 * URI:DIR:... : mutable, writable 29 * URI:DIR-RO:... : mutable, not writable 28 30 29 Note: Currently most files are immutable, and all directories are mutable, but in the future the node type (file or directory) and the mutability will be independent. It's a bad idea to rely on the node type to determine mutability.31 Note: Currently most files are immutable, and directories are mutable by default (except those created by {{{tahoe backup}}}), but mutable files and immutable directries are possible. It's a bad idea to rely on the node type to determine mutability. 30 32 33 In Python code that is part of or linked with Tahoe, you should probably avoid parsing the URI yourself. Instead create an {{{IURI}}} object using {{{uri.from_string}}}, then call {{{is_mutable()}}} or {{{is_readonly()}}} on the result (note that these will throw an exception if the node {{{is_unknown()}}}). 31 34 32 35 === HTTP methods === … … 39 42 * Python 2.5's stdlib modules ({{{httplib}}}, {{{urllib}}}) provide good support for arbitrary methods. 40 43 * The following clients do not seem to support either {{{PUT}}} and {{{DELETE}}}: 41 * ...42 * We have not yet determined if the following have support for arbitrary methods: 43 * Common web browsers. In general, HTML forms can only cause GET and POST operations. Javascript might have more abilities.44 * Common web browsers. In general, HTML forms can only cause GET and POST operations. {{{XMLHttpRequest}}} is similarly restricted, I think. 45 46 A good command-line HTTP client (written in Python) that supports making arbitrary HTTP requests is [http://code.google.com/p/restez/ restez]. For Windows only, a useful debugging proxy for capturing HTTP requests made by browsers and other clients is [http://www.fiddler2.com Fiddler2]. 44 47 45 48 === Race Conditions === 46 49 47 Race conditions commonly exist in programs which use traditional directory structure interfaces. The webapi.txt document describes how to avoid many of these situations by relying on file URI 's, instead of their vdrive names.50 Race conditions commonly exist in programs which use traditional directory structure interfaces. The webapi.txt document describes how to avoid many of these situations by relying on file URIs in preference to paths. 48 51 49 52 = See Also =