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 - 2000, 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.102 2001/08/01 19:35:05 per Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.103 2001/08/13 18:18:48 per 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:201:   #define FILTER_INTERNAL_FILE(f, id) \    (!id->misc->internal_get && sizeof (filter (internal_files, glob, (f/"/")[-1])))      mixed stat_file( string f, RequestID id )   {    Stat fs;       FILESYSTEM_WERR("stat_file for \""+f+"\"" +    (id->misc->internal_get ? " (internal)" : ""));    +  f = path+f; +     if (FILTER_INTERNAL_FILE (f, id))    return 0;       if(stat_cache && !id->pragma["no-cache"] && -  (fs=cache_lookup("stat_cache",path+f))) +  (fs=cache_lookup("stat_cache",f)))    return fs[0];    object privs;    if (access_as_user && ((int)id->misc->uid) && ((int)id->misc->gid))    // NB: Root-access is prevented.    privs=Privs("Statting file", (int)id->misc->uid, (int)id->misc->gid );       /* No security currently in this function */ -  fs = file_stat(decode_path(path + f)); +  fs = file_stat(decode_path(f));    privs = 0;    if(!stat_cache) return fs; -  cache_set("stat_cache", path+f, ({fs})); +  cache_set("stat_cache", f, ({fs}));    return fs;   }      string real_file( string f, RequestID id )   {    if(stat_file( f, id ))    return path + f;   }      int dir_filter_function(string f, RequestID id)
Roxen.git/server/modules/filesystems/filesystem.pike:381:   {    if( path_encoding != "iso-8859-1" )    p = Locale.Charset.encoder( path_encoding )->feed( p )->drain();   #ifndef __NT__    if( String.width( p ) != 8 )    p = string_to_utf8( p );   #else    while( strlen(p) && p[-1] == '/' )    p = p[..strlen(p)-2];   #endif + #if constant( system.normalize_path ) +  p = system.normalize_path( p ); + #endif    return p;   }         int _file_size(string X, RequestID id)   {    Stat fs;    if( stat_cache )    {    array(Stat) cached_fs;