Opening and Editing Quark Binaries

From: Date: Sun, 14 Jul 2002 09:02:36 +0000
Subject: Opening and Editing Quark Binaries
Groups: php.general 
Request: Send a blank email to php-general+get-107590@lists.php.net to get a copy of this message
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

« previous php.general (#107590) next »