Branch: Tag:

2001-05-31

2001-05-31 22:50:31 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

workaround for case insensetive filesystems...

Rev: lib/master.pike.in:1.155
Rev: lib/modules/System.pmod:1.2
Rev: lib/modules/system.pmod:1.1
Rev: src/modules/system/Makefile.in:1.11

1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.154 2001/05/24 18:14:28 grubba Exp $ +  * $Id: master.pike.in,v 1.155 2001/05/31 22:50:30 hubbe Exp $    *    * Master-file for Pike.    *
181:    return 0;   }    - //! @global - //! Compile the Pike code contained in the file @[filename] into a program. - //! - //! This function will compile the file @[filename] to a Pike program that can - //! later be instantiated. It is the same as doing - //! @code{@[compile_string](@[Stdio.read_file](@[filename]), @[filename])@}. - //! - //! @seealso - //! @[compile()], @[compile_string()], @[cpp()] - //! - program compile_file(string filename, -  object|void handler, -  void|program p, -  void|object o) - { -  AUTORELOAD_CHECK_FILE(filename); -  return compile(cpp(master_read_file(filename), -  filename, -  1, -  handler, -  compat_major, -  compat_minor), -  handler, -  compat_major, -  compat_minor, -  p, -  o); - } -  -  +    #ifdef GETCWD_CACHE   string current_path;   int cd(string s)
230:    return combine_path(IS_ABSOLUTE_PATH(path)?"/":getcwd(),path);   }    + #define Stat _static_modules.files.Stat   #ifdef FILE_STAT_CACHE      #define FILE_STAT_CACHE_TIME 20
237:   int invalidate_time;   mapping(string:multiset(string)) dir_cache = ([]);    - #define Stat _static_modules.files.Stat +    Stat master_file_stat(string x)   {    string file, dir=combine_path_with_cwd(x);
255:    {    if(array(string) tmp=get_dir(dir))    { + #ifdef __NT__ +  tmp=map(tmp, lower_case); + #endif    d=dir_cache[dir]=aggregate_multiset(@tmp);    }else{    dir_cache[dir]=0;    }    }    -  + #ifdef __NT__ +  file=lower_case(file); + #endif    if(d && !d[file]) return 0;       return predef::file_stat(x);
272:   mapping (string:string) environment=([]);       +    //! @global   //! @decl string getenv(string varname)   //! @decl mapping(string:string) getenv()
289:    return environment[s];   }    +  + //! @global + //! Compile the Pike code contained in the file @[filename] into a program. + //! + //! This function will compile the file @[filename] to a Pike program that can + //! later be instantiated. It is the same as doing + //! @code{@[compile_string](@[Stdio.read_file](@[filename]), @[filename])@}. + //! + //! @seealso + //! @[compile()], @[compile_string()], @[cpp()] + //! + program compile_file(string filename, +  object|void handler, +  void|program p, +  void|object o) + { +  AUTORELOAD_CHECK_FILE(filename); +  return compile(cpp(master_read_file(filename), +  filename, +  1, +  handler, +  compat_major, +  compat_minor), +  handler, +  compat_major, +  compat_minor, +  p, +  o); + } +  +  +    #if 0   variant mapping(string:string) getenv()   {