Roxen.git / server / modules / filesystems / tarfs.pike

version» Context lines:

Roxen.git/server/modules/filesystems/tarfs.pike:1:   // This is a ChiliMoon module. Copyright © 2000 - 2001, Roxen IS.    - inherit "module"; +     - constant cvs_version = "$Id: tarfs.pike,v 1.14 2004/07/17 23:01:37 _cvs_stephen Exp $"; + constant cvs_version = "$Id: tarfs.pike,v 1.15 2005/02/10 23:12:00 _cvs_dirix Exp $";      // The Filesystem.Tar module is not threadsafe. - constant thread_safe = 0; +       #include <module.h> -  + inherit "module";    -  + constant thread_safe = 0; +    constant module_type = MODULE_LOCATION;   constant module_name = "File systems: Tar File";   constant module_doc =   ("This is a file system module that makes it possible to mount a "    "directory structure from a tar-file directly on the site. gzip compressed "    "tar-files are not supported");   constant module_unique = 0;      void create()   {
Roxen.git/server/modules/filesystems/tarfs.pike:54:         string query_location()   {    return mp;   }      Stat stat_file( string f, RequestID id )   {    if(!tar) return 0; -  object s = tar->stat( f ); -  if( s ) -  return ({ s->mode, s->size, s->atime, s->mtime, s->ctime, s->uid, s->gid }); +  Stdio.Stat s = tar->stat( f ); +  if( !s ) return 0; +  return s;   }      string real_file( string f, RequestID id )   {    return 0;   }      array find_dir( string f, RequestID id )   {    if(!tar) return 0;    return tar->get_dir( f );   }    - mixed find_file( string f, RequestID id ) + int|Stdio.FakeFile find_file( string f, RequestID id )   {    if(!tar) return 0; -  object s = tar->stat( f ); +  Stdio.Stat s = tar->stat( f );    if( !s ) return 0;    if( s->isdir() ) return -1; -  return Stdio.FakeFile( tar->open( f, "r" )->read(), -  stat_file( f, id )); +  string content = tar->open( f, "r" )->read(); +  Stdio.FakeFile res = Stdio.FakeFile( content , "r" ); +  return res;   }