On Sat, 2004-03-06 at 09:40, James Curbo wrote:
If I run the attached script, I get this crash: james pioneer:~$ perl vfstest.pl Use of uninitialized value in subtraction (-) at vfstest.pl line 26. libgnomevfs-CRITICAL **: file gnome-vfs-socket-buffer.c: line 169 (gnome_vfs_socket_buffer_read): assertion `buffer != NULL' failed at vfstest.pl line 26. Segmentation fault
The problem is that sf.net doesn't provide the size of the file you requested. Thus, $info->{size} is undefined. In cases like that you have to take another approach: read a certain amount of bytes per iteration, append everything you get to the buffer and stop when you get the end-of-file error. The attached patch does that. (The patch also does s/\$@/\$result/g -- Gnome2::VFS doesn't croak on error.) All that said, Gnome2::VFS should probably not segfault -- I'll look into it. Bye, -Torsten
Attachment:
vfstest.patch
Description: Text Data