Roxen.git / server / modules / tags / writefile.pike

version» Context lines:

Roxen.git/server/modules/tags/writefile.pike:6:   // modify it under the terms of the GNU General Public License as published   // by the Free Software Foundation; either version 2, or (at your option) any   // later version.   //      //<locale-token project="mod_writefile">_</locale-token>   #define _(X,Y) _DEF_LOCALE("mod_writefile",X,Y)   #define _ok id->misc->defines[" _ok"]      constant cvs_version = -  "$Id: writefile.pike,v 1.15 2003/06/26 15:59:20 anders Exp $"; +  "$Id: writefile.pike,v 1.16 2003/09/24 09:49:37 anders Exp $";   constant thread_safe = 1;      #include <module.h>   #include <config.h>      inherit "module";         // ---------------- Module registration stuff ----------------   
Roxen.git/server/modules/tags/writefile.pike:97:       if (QUERY(onlysubdirs))    rootpath = path;    else    rootpath = "/";       string filename =    Stdio.append_path(((schroot+args->filename)[0]=='/'?    rootpath:path),    Stdio.append_path(schroot, args->filename)); -  string real_dirname = id->conf->real_file(dirname(filename)+"/",id); +  // Search for an existing real directory +  string d = dirname(filename); +  string real_dirname = id->conf->real_file(d+"/",id); +  string new_dir = ""; +  while (!real_dirname && sizeof(d)) { +  new_dir = Stdio.append_path(basename(d), new_dir); +  d = dirname(d); +  if (d == "/") d = ""; +  real_dirname = id->conf->real_file(d+"/",id); +  }    if (!real_dirname)    parse_error ("There is no file system for %O that supports this tag "    "(i.e. implements real_file).\n", dirname(filename));    -  real_filename = Stdio.append_path(real_dirname, basename(filename)); +  real_filename = Stdio.append_path(real_dirname, new_dir, +  basename(filename));       if(args->remove) {    if(!rm(real_filename))    _ok = 0;    }    else    if(IS(args->moveto)) {    string filename =    Stdio.append_path(((schroot+args->moveto)[0]=='/'?    rootpath:path),
Roxen.git/server/modules/tags/writefile.pike:136:    string towrite;    if(args->from) {    towrite=RXML.user_get_var(args->from, "form");    if(!towrite ||    IS(args["max-size"]) && sizeof(towrite)>(int)args["max-size"]) {    _ok = 0;    return 0;    }    }    else -  towrite=content; +  towrite=content||"";    object privs;    ;{ Stat st;    string diro,dirn;    int domkdir=0;    for(dirn=real_filename;    diro=dirn, diro!=(dirn=dirname(dirn)) && !(st = file_stat(dirn));    domkdir=1);    if(st) {    privs = Privs("Writefile", st->uid, st->gid);    if(domkdir && args->mkdirhier)