Results 1 to 2 of 2

Thread: accessing files on network

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Cambridge, UK
    Posts
    5
    I've written my first program for a network.
    The app has to input data and output data to a maximum of 1000 small files from several workstations at the same time. Only a few of these files exist at the moment and there have been no problems. However I would like to know what problems can arise as the amount of files increase. I have no understanding of open and closing files safely. All these files are read by the app but only for as long as it takes for the data to be read into variable arrays.
    Any help would be appreciated
    Thanks
    Alan

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Opening and closing the files

    Hi AlanRCo,

    One thing that you should be concerned with when dealing with so many files is the number that you assign to the files. e.g.
    Code:
    Open "c:\windows\desktop\myfile.txt" For Input As #1
    Close #1
    You should use the Freefile function so that you don't have to keep track of all those file numbers. e.g.
    Code:
    Dim iFileNum As Integer
    
    iFileNum = Freefile
    
    Open "c:\windows\desktop\myfile.txt" For Input As #iFileNum
    Close #iFileNum
    I hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width