Re: VMS::Time module

"John E. Malmberg" <[email protected]> Thu, 27 Dec 2012 20:52:43 -0600
Newsgroups gmane.comp.lang.perl.ports.vms
Message-ID <[email protected]>
On 12/24/2012 4:19 PM, Thomas Pfau wrote:
> I wrote a time module that interfaces to the VMS time system services -
> $BINTIM, $ASCTIM, $GETTIM, and $NUMTIM.  I also had a replacement routines
> for $ASCTIM, $BINTIM and $GETTIM that could be used on non-VMS platforms.
>
> Currently it accepts and returns VMS time buffers as 8 byte strings but I
> was thinking of allowing numeric values to be passed if perl was built with
> 64 bit integer support.  I could detect the input format by using
> SvIOK/SvPOK.  The problem I have is determining how the user wants the
> information returned.

Can you use wantarray?

> Current interface ($now and $bin are 8 byte strings containing the time):
>        $now = gettim();
>        $bin = bintim('01-jan-2010 12:00:00.00');
>        $asc = asctim($bin);
>        ($year, $month, $day, $hr, $mn, $sc, $cc) = numtim($bin);
>
> I'm thinking of using an optional additional argument on gettim and bintim
> that would be written with the 8 byte string and have the routines return
> the time as an integer if perl is built with 64 bit integers.  I could try
> to interface to the bigint module and return a bigint value if 64 bit
> integers aren't available.

> Would anyone find this useful?  Any comments on the interface?

It might be useful.  As I posted earlier, I am looking at what it would 
take to implement a perl script that could be run detached to keep a VMS 
directory synchronized with Dropbox.

While I have not yet started my investigation, I suspect that I will 
need to convert time stamps from the DropBox server to that of the VMS 
server.  These time stamps might be in Windows format or Linux format, 
so I would need a way to convert and compare the timestamps, hopefully 
with the least loss of precision.

Regards,
-John
Personal Opinion Only