Branch: Tag:

2001-10-30

2001-10-30 22:24:53 by Stephen R. van den Berg <srb@cuci.nl>

Provide status information.
Utilise native Stat struct.

Rev: server/modules/tags/writefile.pike:1.10

10:      #define _ok id->misc->defines[" _ok"]    - constant cvs_version = "$Id: writefile.pike,v 1.9 2001/10/30 21:29:17 srb%cuci.nl Exp $"; + constant cvs_version = +  "$Id: writefile.pike,v 1.10 2001/10/30 22:24:53 srb%cuci.nl Exp $";   constant thread_safe = 1; - constant language = roxen->language; +       #include <module.h>   #include <config.h>
44:    );   }    + static string lastfile; +  + string status() { +  return sprintf("Last file written: %s",lastfile||"NONE"); + } +    #define IS(arg) ((arg) && sizeof(arg))      // ------------------- Containers ----------------
111:    diro=dirn, diro!=(dirn=dirname(dirn)) && !(st = file_stat(dirn));    domkdir=1);    if(st) { -  privs = Privs("Writefile", st[5], st[6]); +  privs = Privs("Writefile", st->uid, st->gid);    if(domkdir && args->mkdirhier)    Stdio.mkdirhier(dirname(filename));    }    }    _ok = 0;    object file=Stdio.File(); -  if(file->open(filename, args->append?"wrca":"wrct")) { +  if(file->open(lastfile=filename, args->append?"wrca":"wrct")) {    _ok = 1;    file->write(towrite);    object dims;