[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Strange behaivor of get method of handle class



I met a strange behaivor of get method of handle class object when I was 
writing a script to manupulate aete resouce.

For example, could you see a following script. This script read aete resouce 
of Encode URL OSAX.

use Mac::Memory;use Mac::Resources;

$target = 'Macintosh HD:Encode URL ト:Encode URL';

$RF = OpenResFile($target);$temp_handle = Get1Resource('aete', 0);

$aete_handle = new Handle $temp_handle->get;CloseResFile($RF);print 
$aete_handle->get(29, 0);ReleaseResource($aete_handle)

The output to STDOUT is '[syso'.  0 length to read data is given to get 
method of handle class. But 5 byte data is returned.When 0 length is given, 
get method of handle class sometimes returns unexpected results. Does 0 
length have special meaning in get method ? 
-- 
==================================================
 Tetsuro Kurita
 E-mail:tkuri@tac.tsukuba.ac.jp
==================================================

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org