open("r"); echo "the file reads:
";
  while($str=$myfile->read(4096))
    echo $str;
  echo "
"; //close the file pointer $myfile->close(); //create an file object for write, assuming the path is "/tempZone/home/demouser/test_write.txt" $myfile=new ProdsFile($account,"/tempZone/home/demouser/test_write.txt"); //write hello world to the file, onto "demoResc" as resource. Note that resource name is //required here by method open(), because iRODS needs to know which resource to write to. $myfile->open("w+","demoResc"); $bytes=$myfile->write("Hello world!\n"); //print the number of bytes writen echo "$bytes bytes written
\n"; $myfile->close(); ?>