pike.git / lib / modules / Stdio.pmod

version» Context lines:

pike.git/lib/modules/Stdio.pmod:148:      object(FILE) stdin=FILE("stdin");      string read_file(string filename,void|int start,void|int len)   {    object(FILE) f;    string ret, tmp;    f=FILE();    if(!f->open(filename,"r")) return 0;    +  // Disallow devices and directories. +  array st; +  if (f->stat && (st = f->stat()) && (st[1] < 0)) { +  throw(({ sprintf("Stdio.read_file(): File \"%s\" is not a regular file!\n", +  filename), +  backtrace() +  })); +  } +     switch(query_num_arg())    {    case 1:    ret=f->read(0x7fffffff);    break;       case 2:    len=0x7fffffff;    case 3:    while(start-- && f->gets());
pike.git/lib/modules/Stdio.pmod:180:   }      string read_bytes(string filename,void|int start,void|int len)   {    string ret;    object(File) f = File();       if(!f->open(filename,"r"))    return 0;    +  // Disallow devices and directories. +  array st; +  if (f->stat && (st = f->stat()) && (st[1] < 0)) { +  throw(({sprintf("Stdio.read_bytes(): File \"%s\" is not a regular file!\n", +  filename), +  backtrace() +  })); +  } +     switch(query_num_arg())    {    case 1:    case 2:    len=0x7fffffff;    case 3:    f->seek(start);    }    ret=f->read(len);    f->close();