To many open files

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.
Post Reply
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

To many open files

Post by nemesis »

Hi,

I've run into this before and now it's back "To many open files". Resulting in a script CRASH! Running on WinPE build from latest Win10 prof build x64 version.

The documentation says "Note: Although the script interpreter will make sure that all opened files are closed eventually, you should explicitly
close any files you open. This will prevent you from running out of file handles if your script needs to open several files."

I have of course made sure that I only keep file handlers open when required (forcing me to open and close the log files over and over for each line written with obvious detremental effects!)

A few questions:
- How many file handlers are allowed? I would assume 512/2048/16384 however, from testing it seems to be 5! Really?
- Can I view what handlers are open? If so how.
- Can I have it error and return the fabled -1 instead of crashing? If so how. The crashing and not having a proper error mechanism is one of the biggest issues in tbsscript, only superseeded by the ever so fun gues what my type and or value is in what I like to call are there miss spelled variables roulet...
- Can I increase the number of allowed file handlers? I'm running on a dual proc Xeon which supports 64 threads and has almost a TB of RAM.

My test for open file handlers allowed:
Sub Main()
i = 0
files = 0
While (1 = 1)
i = i + 1
PrintL(i)
files = open(test # i)
wend
End Sub
Regards,

Davy Vaessen
ICT+ Netherlands
TeraByte Support
Posts: 3199
Joined: Thu May 05, 2011 10:37 pm

Re: To many open files

Post by TeraByte Support »

It's currently 4, but the next release is expand to 120.

It doesn't "crash" the script "aborts" and notifies of the issue.
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Re: To many open files

Post by nemesis »

TeraByte Support wrote: Wed Dec 15, 2021 11:32 pm It's currently 4, but the next release is expand to 120.
What's the eta on the next release?
TeraByte Support wrote: Wed Dec 15, 2021 11:32 pm It doesn't "crash" the script "aborts" and notifies of the issue.
That's a semantic difference. According to documentation it should return -1 on a failure, which it does not. It "aborts" the script execution in the midle of operations without a possability of recovery.

What is a end user going to do with the message that the script aborted because there are no free file handlers?
Regards,

Davy Vaessen
ICT+ Netherlands
TeraByte Support
Posts: 3199
Joined: Thu May 05, 2011 10:37 pm

Re: To many open files

Post by TeraByte Support »

Probably before Christmas.

If a file open fails it returns -1 based on file doesn't exist or something like that but out of handles aborts so the script can be fixed.
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Re: To many open files

Post by nemesis »

Hi, ok thnx can you update this thread once released?
Regards,

Davy Vaessen
ICT+ Netherlands
TeraByte Support
Posts: 3199
Joined: Thu May 05, 2011 10:37 pm

Re: To many open files

Post by TeraByte Support »

keep an eye out for the version forum or subscribe to the newsletter or RSS feed on the website.
Post Reply