WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: CoreyGlenn on December 18, 2014, 09:03:52 AM

Title: Is there a workaround to error 3078? (Maximum of 128 files open at one time)
Post by: CoreyGlenn on December 18, 2014, 09:03:52 AM
I am processing large numbers of files in a folder with a single script execution. I am using the FileClose and Drop function to close the filehandle and drop the filehandle's variable after each file is processed. Yet I still get the #3078 error saying Too Many Files open > 128.

I thought maybe I'm not closing out all the files but right after I reach end of file *EOF* I call a routine to FileClose the handle and drop the variable so it's pretty straightforward.
Is there an IntControl around this or is there something that can be read to determine how many files are open in a single script execution?


On a FileOpen function, you are limited to a maximum of 128 files open at one time.
Article ID:   W12996

Filename:   Limitations - Maximum Amounts .txt
File Created: 2010:02:17:10:58:54
Last Updated: 2014:07:18:08:51:38

Thanks,

Corey



Title: Re: Is there a workaround to this limit? (Maximum of 128 files open at one time)
Post by: td on December 18, 2014, 09:17:48 AM
Calling FileClose on a file handle returned by FileOpen will make the handle table slot available for reuse. Dropping a variable that contains a file handle integer will not.  You may want to check the logic of your script.
Title: Re: Is there a workaround to error 3078? (Maximum of 128 files open at one time)
Post by: CoreyGlenn on December 18, 2014, 09:24:44 AM
Hi TD,  I've been through my logic a few times tracing through and it would be helpful to verify the filehandle table count. Is there a way to check the filehandle table?


Thanks,
Corey
Title: Re: Is there a workaround to error 3078? (Maximum of 128 files open at one time)
Post by: td on December 18, 2014, 09:51:22 AM
Please see the help file topic for IntControl 77. Requests 20 and 21 can be used to obtain information about the file handle table.
Title: Re: Is there a workaround to error 3078? (Maximum of 128 files open at one time)
Post by: CoreyGlenn on December 18, 2014, 09:56:28 AM
td....How cool are you man!!!???? Thanks very much!!!

P.S. I learned to look a little harder at the online manual. Sometimes you're not able to hit all the right keywords to search on. I appreciate your support.

Thanks again!

Corey