Trap is if file pointer changes, as open file variable does not. Most common reasons are VOC pointer changing, or user logs to another account (where file pointers are different).
Suggest additional array in the file common of (LOWERed) VOC record at time of opening: check each time someone looks for the file to make sure VOC has not changed. On 6 March 2012 07:41, Ed Clark <[email protected]> wrote: > So the guru question is: Does either universe or unidata provide a way to > get a list of opened files from some internal list or pool? > I don't think so. Your application will need to keep track of each file as > it opens them. Somewhere there's a universe technical bulletin that > describes a method for this. you use a named common which contains 2 > arrays, one for file names, and one for file pointers. When you want to > open a file, you LOCATE into the name array and use the associated file > pointer if found. If not, you open the file and add the name and pointer to > the array. > On Mar 5, 2012, at 12:57 PM, Wjhonson wrote: > > > > > I have to guess that the OP really wanted something like > > N.FILE = "CUSTOMER"; GOSUB CHECK.IF.FILE.IS.OPEN > > IF ERROR.FILE THEN > > OPEN N.FILE TO F.FILE ELSE do something here > > END ELSE > > IS.OPEN = TRUE > > END > > > > CHECK.IF.FILE.IS.OPEN: > > some function which checks if N.FILE exists in some rotating pool of > FILE(MAXFILES) > > if so return file variable pointer set in F.FILE else set error flag in > ERROR.FILE > > RETURN > > > > > > Of course the pseudo code above has to be filled in with appropriate > site specific code > > Here we use a subroutine FILE.OPEN whose pool of open files lives in > global named common > > > > I really think that is what the OP was after > > > > > > -----Original Message----- > > From: David Wolverton <[email protected]> > > To: 'U2 Users List' <[email protected]> > > Sent: Mon, Mar 5, 2012 9:51 am > > Subject: Re: [U2] Hello > > > > > > In that case, where every file is named "FILE" in your programs, but you > > ant to make sure FILE is opened against CUSTOMER, I would guess you would > > o this: > > IF (FILEINFO(FILE, 0) = 0) THEN > > OPEN 'CUSTOMER' TO FILE ELSE > > .... > > END > > ND ELSE > > IF FILEINFO(FILE,17) # "CUSTOMER" THEN > > CLOSE FILE > > OPEN 'CUSTOMER' TO FILE ELSE > > .... > > END > > END > > ND > > > > David W. > > > > ----Original Message----- > > rom: [email protected] > > mailto:[email protected]] On Behalf Of Wjhonson > > ent: Monday, March 05, 2012 11:06 AM > > o: [email protected] > > ubject: Re: [U2] Hello > > > > don't think this will work. > > n your example John, you need to know the file variable assigned to the > > ile. > > o > > F (FILEINFO(CUSTOMER,0)=0) THEN > > OPEN "CUSTOMER" TO CUSTOMER ELSE... > > But you can't use FILEINFO to check "CUSTOMER", only to check CUSTOMER. > > o you can't tell if a file is opened already and to what file variable. > > ou can only tell if a certain file variable is opened. > > > > -----Original Message----- > > rom: Israel, John R. <[email protected]> > > o: 'U2 Users List' <[email protected]> > > ent: Mon, Mar 5, 2012 7:56 am > > ubject: Re: [U2] Hello > > > > assume you have some way of knowing what files you want. > > o something like: > > F (FILEINFO(yourfilename, 0) = 0) THEN > > PEN yourfilename ... > > D > > ohn > > ----Original Message----- > > om: [email protected] > > mailto:[email protected]] > > Behalf Of Dave Laansma > > nt: Monday, March 05, 2012 10:38 AM > > : U2 Users List > > bject: Re: [U2] Hello > > kay, I've got a pretty simple question ... > > ow do I get a list of all files that are currently OPEN so I know > whether I > > ed to open a given file again? > > incerely, > > vid Laansma > > Manager > > bbard Supply Co. > > rect: 810-342-7143 > > fice: 810-234-8681 > > x: 810-234-6142 > > w.hubbardsupply.com > > elivering Products, Services and Innovative Solutions" > > ----Original Message----- > > om: [email protected] > > ailto:[email protected]] On Behalf Of u2ug > > nt: Monday, March 05, 2012 10:32 AM > > : U2 Users List > > bject: [U2] Hello > > s the list alive ? Haven't seen anything for a week. > > ______________________________________________ > > -Users mailing list > > [email protected] > > tp://listserver.u2ug.org/mailman/listinfo/u2-users > > _____________________________________________ > > -Users mailing list > > [email protected] > > tp://listserver.u2ug.org/mailman/listinfo/u2-users > > ______________________________________________ > > -Users mailing list > > [email protected] > > tp://listserver.u2ug.org/mailman/listinfo/u2-users > > _______________________________________________ > > 2-Users mailing list > > [email protected] > > ttp://listserver.u2ug.org/mailman/listinfo/u2-users > > > > ______________________________________________ > > 2-Users mailing list > > [email protected] > > ttp://listserver.u2ug.org/mailman/listinfo/u2-users > > > > _______________________________________________ > > U2-Users mailing list > > [email protected] > > http://listserver.u2ug.org/mailman/listinfo/u2-users > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > -- Kate Stanton Walstan Systems Ltd 4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand Phone: + 64 9 360 5310 Mobile: + 64 21 400 486 Email: [email protected] _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
