title: Detecting if a file is already open in javascript
body: <p>How can I check to see if a file is already open by another user in javascript?  As it is right now, the program I'm trying to fix will open/edit a file then fail on trying to save if the file is already in use.</p>
  
  <p>Also, is there an easy way to add a lock on the file so another process knows it's in use?</p>
  
  <p>Edit: the program is a .hta using Active X Objects.</p>
  
  <p>i guess i should have been more specific, here's some code about how it is opening/editing/saving the files.</p>
  
  <pre><code>var FileSystem = new ActiveXObject( "Scripting.FileSystemObject" );
  var xmlDoc = new ActiveXObject( "Msxml2.DOMDocument.3.0" );
  var fFile = FileSystem.GetFile( strPath );
  xmlDoc.load( fFile.Path );
  // some method's to edit documentElement in xmlDoc...
  xmlDoc.save( fFile.Path );
  </code></pre>