I'm stuck here...
I'm opening a file, messing with the contents, and writing it to another file.
- Both files open fine.
- Destination file opens fine, creates a blank file (like it should)
- is_writable($destinationFile) comes up false! Wtf?
Here's my code:
Code: Select all
$inpath = $_SERVER['DOCUMENT_ROOT']. "\\web\\";
$outpath = $_SERVER['DOCUMENT_ROOT']. "\\web\\output\\";
$handle = fopen($inpath . $fileNames[$i], "r");
$newFile = fopen($outpath . $fileNames[$i], 'w+');
while (!feof($handle)) {
$theLine = fgets($handle);
// Do stuff to $theLine
}
if(is_writable($newFile)) {
echo "WRITABLE: ";
if(fwrite($newFile,$LineDone) === false) echo "<br>Error WRITING TO FILE!!";
else echo "<br>Written";
}
else { echo "UNWRITABLE"; }Thanks!