[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - read/write arbitrary chunk of a file

read/write arbitrary chunk of a file

Q&A's, tips, howto's

read/write arbitrary chunk of a file

Postby Sammo » Thu Dec 18, 2003 2:01 pm

With (slice (read-file "filename") start count) I can read any contiguous chunk of bytes from a file, but from a very large file how might I read and then later write a contiguous block of, say, 128 bytes? In particular, for reading and later updating v1.0 and v1.1 mp3 tags I'd like to read and write the last 128 bytes in a largish file. I thought that (seek an-open-file -128) and then a (read-buffer ...) would be a good start, but that didn't work. Is (slice (read-file ...)) the way to go or have I missed the obvious?
Sammo
 
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Postby Lutz » Thu Dec 18, 2003 3:55 pm

Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby Sammo » Thu Dec 18, 2003 4:06 pm

Sammo
 
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests

cron