I've been trying to open and end some of the ascii portions of Quark Express
binary files, (I'm using PHP4 on MacOSX, the quark files are OS9 files).

Even if I make the simplest eregi_replace () having done ...

$fd = fopen ($file, "rb+");
$contents = fread ($fd, filesize ($file));
fclose ($fd);

 ... then the edits ... 
 
 ... and then ...
 
touch ($new_filename);
$fd = fopen ($new_filename, "ab+");
fwrite ($fd, $contents);
fclose ($fd);

... quark reports things like unexpected EOF (even though when I open the file
in a text editor they have same number of lines and "look" identical), I've also
tried a few things with the Mac resource forks to no avail.

Has anyone tried something like this before? Does the fread() fwrite() change
line endings from mac to unix or something?

Kind of an obscure subject, but hoping for a clue from somewhere.

Zim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to