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

[MacPerl] truncate Question



I'm trying to use truncate to chop some bytes off the end of a file, and 
having no luck.  Instead of truncating the file, truncate seems to extend 
it...  For example:

  #!perl -w
  open(XXX, ">test");
  print XXX "Hi there";
  truncate(XXX, 5);

produces the following file (hex dump):

  00 00 00 00 00 48 69 20 74 58 65 72 65

What I expected was:

  48 69 20 74 58

What am I missing?

Thanks,
-Dave

-- 
David H. Emme        demme@ix.netcom.com
"Nobody would do anything if they knew what they were in for!"
  - Amarante Cordoba, "The Milagro Beanfield War"


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch