Click to See Complete Forum and Search --> : Write concurrently to log file


shers
March 30th, 2008, 02:42 AM
Hi all,

I have created a VB Script file that runs when the user logs in, and writes the username and date & time to a log file. The vbs file as well as the log file is a network location that contains more than 3 users. I would like to know what would happen if more than one user logs in at the same time? Will it write the details of both users concurrently to the log file?

Thanks

PeejAvery
March 30th, 2008, 02:27 PM
As long as you are not truncating the file, it will write to the log in the order that each person logs in.

shers
March 31st, 2008, 12:43 AM
Suppose it is writing for one person and at the same time another person logs in. Will it write to the log at the same time when the other person is writing to it?

PeejAvery
March 31st, 2008, 06:59 PM
Writing to a log file takes nano seconds for a computer. If you had 100 computers logging to this file, that might be a different story. Worst case scenario, the computer will lock the open file so that the second activity is not logged.

The chances of two people hitting that file at such an exact nano second is near to impossible.