Pow file open

From PlainOldWebserver

Jump to: navigation, search

Pow_file_open( filename, rwa_flags )

Opens a filestream for reading.

  <pre>
  <?sjs
    var lines = "This is a file\nIt has a nice ending";
  pow_file_put_contents("test.txt",lines,"w");
  var fh = pow_file_open("test.txt","r");   var line = "";   var count = 0;   while(line = pow_file_line(fh)) {      document.write(++count + ": " + line);   }   pow_file_close(fh);  ?> </pre>

Result:

  1: This is a file
  2: It has a nice ending

Personal tools
Navigation