Hi All, Is there any way to get a file lock in ASP so that no one else can write to file at that particular time and when I call releaseLock, the lock will be released? I would appreciate any help in this regard. Thanks in advance!! Best Regards, Inderpal Singh
Sure. Use an application variable. if Application("FILELOCKED")<>"true" then Application("FILELOCKED")="true" 'do stuff with the file Application("FILELOCKED")="false" end if Code (markup): To make it wait for the lock, instead of IF...THEN, use DO...LOOP. If you're going to have a lot of connections to your site, you need to make sure two people don't execute the filelock check at the same time, because both would show it was unlocked then both would try to lock it. To do that, you'll have to use Application.Lock.