|
Scott My "Err_Flag" is my file descriptor. *********************************************************** C Sb_SetFile BegSr C Eval Oflag = O_CREAT + O_CODEPAGE + C O_RDWR C Eval Omode = S_IRWXU + S_IROTH C Eval Filename = %Trim(Filename) + Null C Eval Err_Flag = Open(%Addr(Filename) : OFLAG : C Omode: CodePage) C If Err_Flag < 0 C ExSr *Pssr C EndIf C Eval Rc = Close(Err_Flag) C EndSr At the end of the process the same RC = Close(Err_Flag ) is used this is the code: 0628.00 *********************************************************** 0629.00 * Sb_ClsFile - Close PC File in IFS directory 0630.00 *********************************************************** 0631.00 C Sb_ClsFile BegSr 0632.00 0633.00 C Eval Rc = Close(Err_Flag) 0634.00 0635.00 C If Err_Flag < 0 0636.00 C ExSr *Pssr 0637.00 C EndIf 0638.00 0639.00 C EndSr 0640.00 If had any error closing I believe a dump will have been produced. Regards Emmanuel Zannis -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Scott Klement Sent: 13 July 2005 8:21 PM To: Midrange Systems Technical Discussion Subject: Re: Too many open files for this process > The program was working fine on every month end until it bombed on the > last one with the following error message EMFILE 3452 (Too many open > files for this process). I understand that the maximum number of file > descriptors has been reached. How do I change the maximum allowed value > of opened file descriptors? I think the problem is more likely that you're not closing a file or directory properly. I simply can't imagine that you legitimately have hundreds of file descriptors open. > In my rpg I use the c function (Eval Rc = Close(Err_Flag)) to close the > processed file. The parameter to the close() API is the descriptor that you want to close. It's not an error flag. Does your program check to see if Rc is -1? If it is, it means that the close is failing and therefore something is wrong with your code.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.