WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

IntControl 65 and FileRead

Keywords:   intcontrol(65

Question:

I need some clarification on how IntControl(65...), the function to increase the default FileRead line length, works.

Does increasing the maximum line length for FileRead from the default of 4096 to something like, say, 10000, would somehow impact performance, memory usage, etc. I need to understand how the function works so I know how to utilize it in his scripts without sacrificing speed or memory usage. Does allocating 10000, for example, mean that you've allocated that much for each FileRead, regardless of the existing line length?

Answer:

When we open a file for reading, we allocate an internal buffer of maxbuf bytes, which is freed when the file is closed. Each time we need to read from the file, we read maxbuf bytes into the buffer. For each FileRead command, we allocate, use, and then free a return buffer of maxbuf bytes. If we reach a line in the file longer than maxbuf bytes, the FileRead fails.

Some notes on the Intcontrol 65 function:

  1. The max line limit is 1280 ONLY if you specify IntControl(65,0,0,0,0).

  2. The default 4096 if you don't specify something else with that IntControl function, e.g., Intcontrol(65,0,0,0,0).

  3. You may wish to wildly exceed the max line length in your IntControl 65 to improve performance. Maybe....
    Intcontrol(65,200000,0,0,0)
    
    (or even larger, depending on your requirements).

Article ID:   W14231
Filename:   Intcontrol 65 and FileRead.txt
File Created: 2002:11:20:12:04:22
Last Updated: 2002:11:20:12:04:22