Have you had a look at the openpath statement? That shouldn't lock it AFAIK.

   openpath path.house:"ipcs.txt" to f.ipcs then status stat from f.ipcs
   
Stuart

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jacques G.
Sent: Friday, 3 June 2011 03:50
To: U2 Users List
Subject: [U2] [UV] Obtaining a file creation date and time without locking it


Hello,

Currently I have code that does something like this:

EQU TM.LIMIT TO 3 ;* File useable if created less than TM.LIMIT seconds ago.


OPENSEQ PATH.HOUSE:"ipcs.txt" TO F.IPCS ELSE RETURN STATUS STAT FROM F.IPCS THEN
   CLOSESEQ F.IPCS
   IPCS.TM = STAT<15>
   IPCS.DT = STAT<16>
   SEC.PASSED = (DATE() - IPCS.DT) * 86400
   SEC.PASSED += (TIME() - IPCS.TM)
   IF SEC.PASSED > TM.LIMIT THEN RETURN ;* Too old can't use it END

The problem with this approach, is that in order to query the file's internal 
date and time, I have to do an OPENSEQ which locks the file.   This means that 
another process that may need to perform the same check has to wait for the 
lock to be released.

Any way to open the file in a ReadOnly mode in UV so that It won't get locked ?

Jacques

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users



_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to