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 <dwolv...@flash.net>
> To: 'U2 Users List' <u2-users@listserver.u2ug.org>
> 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: u2-users-boun...@listserver.u2ug.org
> mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
> ent: Monday, March 05, 2012 11:06 AM
> o: u2-users@listserver.u2ug.org
> 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. <johnisr...@daytonsuperior.com>
> o: 'U2 Users List' <u2-users@listserver.u2ug.org>
> 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: u2-users-boun...@listserver.u2ug.org
> mailto:u2-users-boun...@listserver.u2ug.org]
> 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: u2-users-boun...@listserver.u2ug.org
> ailto:u2-users-boun...@listserver.u2ug.org] 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
> -us...@listserver.u2ug.org
> tp://listserver.u2ug.org/mailman/listinfo/u2-users
> _____________________________________________
> -Users mailing list
> -us...@listserver.u2ug.org
> tp://listserver.u2ug.org/mailman/listinfo/u2-users
> ______________________________________________
> -Users mailing list
> -us...@listserver.u2ug.org
> tp://listserver.u2ug.org/mailman/listinfo/u2-users
> _______________________________________________
> 2-Users mailing list
> 2-us...@listserver.u2ug.org
> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> ______________________________________________
> 2-Users mailing list
> 2-us...@listserver.u2ug.org
> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> _______________________________________________
> 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