in reply to Re: Re: Re: Unpack for VMS binary files
in thread Unpack for VMS binary files
Elian's code wants to do the unpacking. Try something like this.
@vals = unpack("x8 v12",$buf); $timelow = substr($buf,0,4); $timehigh = substr($buf,4,4);
@vals will contain all the short values. This unpack will skip the first eight bytes (the time field) so the time is no longer returned. Instead, the time is pulled out of the buffer in packed form with substr. You can then pass $timelow and $timehigh to Elian's conversion function.
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Unpack for VMS binary files
by maderman (Beadle) on Feb 25, 2003 at 21:35 UTC | |
by Elian (Parson) on Feb 25, 2003 at 22:26 UTC | |
by maderman (Beadle) on Feb 26, 2003 at 21:05 UTC |