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.87 2000/08/28 05:31:54 per Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.88 2000/08/28 09:54:35 jhs Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>      #if DEBUG_LEVEL > 20   # ifndef FILESYSTEM_DEBUG   # define FILESYSTEM_DEBUG
Roxen.git/server/modules/filesystems/filesystem.pike:377: Inside #if undefined(__NT__)
   if( String.width( p ) != 8 )    p = string_to_utf8( p );   #else    while( strlen(p) && p[-1] == '/' )    p = p[..strlen(p)-2];   #endif    return p;   }       - int _file_size(string X,object id) + int _file_size(string X, RequestID id)   {    Stat fs;    if( stat_cache )    { -  if(!id->pragma["no-cache"]&&(fs=cache_lookup("stat_cache",(X)))) +  array(Stat) cached_fs; +  if(!id->pragma["no-cache"] && +  (cached_fs = cache_lookup("stat_cache", X)))    { -  id->misc->stat = fs[0]; -  return fs[0]?fs[0][ST_SIZE]:-1; +  id->misc->stat = cached_fs[0]; +  return cached_fs[0] ? cached_fs[0][ST_SIZE] : -1;    }    }    if(fs = file_stat(decode_path(X)))    {    id->misc->stat = fs;    if( stat_cache ) cache_set("stat_cache",(X),({fs}));    return fs[ST_SIZE];    } else if( stat_cache )    cache_set("stat_cache",(X),({0}));    return -1;