Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a roxen module. Copyright © 1996 - 2004, Roxen IS.      // This is a virtual "file-system".   // It will be located somewhere in the name-space of the server.   // Also inherited by some of the other filesystems.      inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.156 2007/05/09 16:35:34 grubba Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.157 2008/08/15 12:33:54 mast Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>         //<locale-token project="mod_filesystem">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_filesystem",X,Y)
Roxen.git/server/modules/filesystems/filesystem.pike:42:   LocaleString module_name = LOCALE(51,"File systems: Normal File system");   LocaleString module_doc =   LOCALE(2,"This is the basic file system module that makes it possible "    "to mount a directory structure in the virtual file system of "    "your site.");   constant module_unique = 0;      int redirects, accesses, errors, dirlists;   int puts, deletes, mkdirs, moves, chmods;    - static mapping http_low_answer(int errno, string data, string|void desc) + protected mapping http_low_answer(int errno, string data, string|void desc)   {    mapping res = Roxen.http_low_answer(errno, data);       if (desc) {    res->rettext = desc;    }       return res;   }      // Note: This does a TRACE_LEAVE. - static mapping(string:mixed) errno_to_status (int err, int(0..1) create, + protected mapping(string:mixed) errno_to_status (int err, int(0..1) create,    RequestID id)   {    switch (err) {    case System.ENOENT:    if (!create) {    SIMPLE_TRACE_LEAVE ("File not found");    id->misc->error_code = Protocols.HTTP.HTTP_NOT_FOUND;    return 0;    }    // Fall through.
Roxen.git/server/modules/filesystems/filesystem.pike:102:   #endif       default:    SIMPLE_TRACE_LEAVE ("Unexpected I/O error: %s", strerror (err));    return Roxen.http_status (Protocols.HTTP.HTTP_INTERNAL_ERR,    "Unexpected I/O error: %s",    strerror (err));    }   }    - static int do_stat = 1; + protected int do_stat = 1;      string status()   {    return "<h2>"+LOCALE(3,"Accesses to this filesystem")+"</h2>"+    (redirects?"<b>"+LOCALE(4,"Redirects")+"</b>: "+redirects+"<br>":"")+    (accesses?"<b>"+LOCALE(5,"Normal files")+"</b>: "+accesses+"<br>"    :LOCALE(6,"No file accesses")+"<br>")+    (query("put")&&puts?"<b>"+LOCALE(7,"PUTs")+"</b>: "+puts+"<br>":"")+    (query("put")&&mkdirs?"<b>"+LOCALE(8,"MKDIRs")+"</b>: "+mkdirs+"<br>":"")+    (query("put")&&query("delete")&&moves?
Roxen.git/server/modules/filesystems/filesystem.pike:434:   {    if(f[0]=='.' && !dotfiles) return 0;    if(!tilde && Roxen.backup_extension(f)) return 0;    return 1;   }      array(string) list_lock_files() {    return query("nobrowse");   }    - static mapping(string:mixed)|int(0..1) write_access(string path, + protected mapping(string:mixed)|int(0..1) write_access(string path,    int(0..1) recursive,    RequestID id)   {    SIMPLE_TRACE_ENTER(this, "write_access(%O, %O, %O)\n", path, recursive, id);    if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    SIMPLE_TRACE_LEAVE("%s: Authentication required.", id->method);    // FIXME: Sane realm.    // FIXME: Recursion and htaccess?    return    Roxen.http_auth_required("foo",