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 - 2001, 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.137 2004/05/12 21:21:56 mast Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.138 2004/05/13 12:33:34 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:1257:    return ret;    }       size = _file_size(moveto,id);       SETUID_TRACE("Moving file", 0);       if (size != -1) {    // Destination exists.    -  Overwrite overwrite = -  id->request_headers->overwrite? -  (lower_case(id->request_headers->overwrite) == "t"? -  DO_OVERWRITE:NEVER_OVERWRITE):MAYBE_OVERWRITE; -  if (overwrite == NEVER_OVERWRITE) { +  int(0..1) overwrite = +  !id->request_headers->overwrite || +  id->request_headers->overwrite == "T"; +  if (!overwrite) {    privs = 0;    TRACE_LEAVE("MOVE disallowed (overwrite header:F).");    return Roxen.http_status(412);    }    if(!query("delete"))    {    privs = 0;    id->misc->error_code = 405;    TRACE_LEAVE("MOVE disallowed (DELE disabled)");    return 0;    }    -  if ((overwrite == DO_OVERWRITE) || (size > -1)) { +  if (overwrite || (size > -1)) {    mapping(string:mixed) res =    recurse_delete_files(new_uri, id);    if (res && (!sizeof (res) || res->error >= 300)) {    privs = 0;    TRACE_LEAVE("MOVE: Recursive delete failed.");    if (sizeof (res))    set_status_for_path (new_uri, res->error, res->rettext);    return ([]);    }    } else {