pike.git / NT / tools / lib.pike

version» Context lines:

pike.git/NT/tools/lib.pike:2:   #define strerror(X) X   #endif      #ifdef __NT__   void exece(string cmd, array(string) args)   {    exit(Process.create_process( ({ cmd }) + args )->wait());   }   #endif    - string fixpath(string s) + string follow_symlinks(string s)   { -  string mnt=getenv("NTMOUNT"); +     mixed st; -  +  string x=s;    while ((st = file_stat(s, 1)) && (st[1] == -3)) {    string new_s = readlink(s);    if (new_s == s) {    werror(sprintf("%O is a symlink to itself!\n", s));    exit(1);    } -  s = new_s; +  s = combine_path(getcwd(),dirname(s),new_s);    } -  + // werror("Follow symlink %O -> %O\n",x,s); +  return s; + } +  + string fixpath(string s) + { +  string mnt=getenv("NTMOUNT"); +  s=follow_symlinks(s);    if(mnt && strlen(mnt)) s=replace(s,mnt,"");    return replace(s,"/","\\");   }         string fixabspath(string s)   {    return replace(s,"/","\\");   }      string opt_path(string p1, string p2)   {    return ( ( ((p1||"") + ";" + (p2||"")) / ";" ) - ({""}) ) * ";";   }         int silent_do_cmd(string *cmd, mixed|void filter, int|void silent)   { -  + // werror("%O\n",cmd); +     string ret="";    object(Stdio.File) f=Stdio.File();       switch(getenv("REMOTE_METHOD"))    {    default:    werror("Unknown REMOTE method %s\n",getenv("REMOTE_METHOD"));    break;       case "wine":