GET
and POST
HTTP requests.
http://address/httpfs-command?arguments
.
arguments are one or more arguments, separated by ampersands, each
of the form name=value
.
value may be contained in double quotes, which will be stripped
off; these should be used for arguments that may contain special characters,
such as filenames. Numeric arguments can be expressed in any format
interpretable by strtoul(...,...,0)
; that is, decimal, octal
starting with 0
, or hexadecimal starting with 0x
.
User-Agent
is Replay-HTTPFS/1
.
With standard 4000 software, /Photo
is the only visible export;
/Video
and /SnapshotDir
are invisible exports.
/Video
requires encryption; the others don't (but will accept it).
/Photo
and
/SnapshotDir
are exported writable. /Video
is exported read-only.
0
for success or non-zero for failure; the
status code is separated from the rest of the body by a newline, and may be a
single character 0
or may be longer; use the newline to find the end of
it.
The error codes I know of are:
204
rather than 200
, indicating there is no body. In this case, there is
no status code; I believe you can assume the command succeeded in these
cases.
Transfer-Encoding: chunked
; the Replay server normally does do
so.
If chunked encoding is used, then rather than the body being sent in one
long batch, it's split into multiple chunks. Each chunk looks like
chunk-sizeCRLFchunk-dataCRLF
. The
chunk-size is a hexadecimal number giving the size of the
chunk-data in bytes; it may be followed by a semi-colon and a
'chunk extension'; the Replay's webserver doesn't seem to ever do this. The
end of the body is signalled by a chunk-size of 0; following the
0 CRLF
there are 0 or more lines of trailer, which should be
treated just like HTTP headers, terminated by a final blank
CRLF
terminated line. The Replay doesn't use trailers, either,
so the final chunk can be treated for now as just 0 CRLF CRLF
.
The Replay is perfectly happy to service HTTP/1.0 requests, which don't
allow chunked responses.
cp
copies files.
Arguments:
src | Source | filename to copy from |
dest | Destination | filename to copy to |
create
creates new files.
Arguments:
name | Filename | name of file to create |
fstat
returns file status.
Arguments:
name | Filename | name of file to return status for |
name=value
. Possible
names are:
type | Filetype | f for file or d for directory |
size | Filesize | size in bytes, for files; always -1 for directories |
ctime | Creation time | file's creation time, in milliseconds since midnight January 1 1970 UTC; divide by 1000 to get a unix-style time_t value. Always returns 0 for directories |
perm | Permissions | contains 'r' for read and 'w' for write; the filesystem's writable status isn't taken into account, and 'w' may be returned even for files which can't actually be written |
ls
lists files in a directory.
Arguments:
name | Directory name | name of directory to list |
mkdir
creates a directory.
Arguments:
name | Directory name | name of directory to create |
mv
renames or moves files.
Arguments:
old | Source | old name of file |
new | Destination | new name of file |
readfile
reads the contents of a file and returns it.
Arguments:
name | Filename | the name of the file to read from |
pos | Position | byte offset into the file to start reading from; if omitted, reads from the beginning of the file |
size | Size | the number of bytes to read; if omitted, reads to the end of the file |
rm
deletes files.
Arguments:
name | Filename | name of file to delete |
volinfo
returns filesystem status.
Arguments:
name | Filename | name of filesystem to return status for |
name=value
.
Possible names are:
cap | Capacity | the size of the filesystem, in bytes |
inuse | Used | the number of bytes currently in use in the filesystem |
writefile
writes contents to a file.
Arguments:
name | Filename | the name of the file to write to; it must already exist |
pos | Position | a byte offset into the file to start writing to; if omitted, writes to the beginning of the file |
size | Size | the number of bytes to write; if omitted all the data sent is written. |
writefile
requests must use the POST
HTTP method, and the request header must include a Content-Length
header giving the size of the body. The request body should be the desired file contents with no encoding or modifications.
-- ToddLarason - 09 Mar 2002
Topic HTTPFS . { Edit | Attach | Ref-By | Printable | Diffs | r1.5 | > | r1.4 | > | r1.3 | More } |
Revision r1.5 - 01 Apr 2003 - 04:23 GMT - TWikiGuest Parents: WebHome |
Copyright © 2001 by the contributing authors.
All material on this collaboration tool is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback. |