in reply to Re: Re: Re: Unpack for VMS binary files
in thread Unpack for VMS binary files

You are god! The differences between little endian (VMS) and big endian (Solaris) and the format you provided made the difference. Many thanks... Now to try and convert VMS time to something readable (urrgg). Regards, Stacy.
  • Comment on Re: Re: Re: Re: Unpack for VMS binary files

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Unpack for VMS binary files
by Elian (Parson) on Feb 19, 2003 at 17:31 UTC
    I wrote a pure-perl VMS time to Unix time converter at one point. I can't find the original, but courtesy of google I find it quoted in a mail reply here.
      Ahh, with the VMS time, I have two parts:
      3918795776 9926119 4118795776 9926119 23828480 9926120 223828480 9926120 423828480 9926120
      For the subroutine you mentioned, which is considered the low_long and high_long values? Regards, Stacy.

        The first value should be the low part and the second value the high part.

        --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
        low_long is the least-significant 32 bits of the quadword date, while high_long is the most significant 32 bits. Make sure that you've unpacked things correctly--the code assumes that a VMS system put the bytes on disk, and in VMS endian-order. If that's not the case, then you'll have problems, of course.

        Also, what are the dates supposed to be? Running the conversion on the first date gives me a date of Wed Dec 22 00:14:00 1993, which might well be correct. (Hard to say there)