7 Replies Latest reply on Jun 28, 2011 5:58 AM by suzannemonette

    Shapefile lock problems

    MChilcott
      Hi peoples,

      In ArcGIS 10, I note that if you use ArcCatalog to preview a shapefile, a lock file is written into the folder where the shapefile exists.

      The problem is, that if you now try to copy the folder using Windows Explorer, an error pops up "Error copying file or folder" - Cannot copy <filename>: it is being used by another person or program.  Close any programs that might be using the file and try again.

      This is going to cause us major issues with shapefiles on network drives where multiple people are viewing and copying.

      Has anyone else seen this ?
        • Re: Shapefile lock problems
          Dan_Patterson
          In short, don't use arccatalog and see if the problem goes away I use Explorer exclusively and don't get file locks
          • Re: Shapefile lock problems
            MChilcott
            ArcMap and ArcCatalog create the lock files. 

            Say for example you have many shapefiles in a folder.  If you try to copy the folder, the entire copy will fail.  This means that if anyone is viewing the shapefile in the directory, it makes things very awkward to copy - especially with network drives and multi user environments. 

            Where we have directory structures with many folders, and many shapefiles in each of the folders, if we try to copy the folder hierarchy, this bug will effectively mean we have to ask every user to stop using ArcMap and ArcCatalog so that we can do the copy. 

            This is a real show stopper for us.

            (Should mention we are using WinXP)
            • Re: Shapefile lock problems
              MChilcott
              What I may not have made clear is that ESRI physically place a file named .lock in the folder.

              If you are looking at the folder in windows explorer, you see the file created as soon as you preview the shapefile in ArcCatalog.  When you exit ArcCatalog, the .lock is removed.

              It is the physical creation of the .lock file that is the problem.
              • Re: Shapefile lock problems
                Tomsriv
                This is yet another minor problem with 10 that is giving us headaches.  I had hoped service pack one would have fixed this.  If someone is using ArcMap, ArcCatalog or even ArcReader it creates locks on shapefiles and geodatabases.  Now we cannot copy them to back them up or create a working copy.  It worked fine in 9.3.1.
                • Re: Shapefile lock problems
                  Tomsriv
                  The conspiratorial side of my brain says this is an underhanded way of making people see the advantages of using ArcGISserver.
                  • Re: Shapefile lock problems
                    MKennedy-esristaff
                    The conspiratorial side of my brain says this is an underhanded way of making people see the advantages of using ArcGISserver.


                    It looks like this is now as-designed:

                    http://resources.arcgis.com/content/kbase?fa=articleShow&d=38493

                    (Please don't blame the messenger!)

                    Melita
                    • Re: Shapefile lock problems
                      suzannemonette
                      Hi Everyone,

                      Does anyone know of a work around for this incredibly annoying flaw in ArcGIS 10? I lose track of how many times in a day I have to shut down and restart ArcMap (which is no small feat for the beast ArcGIS 10 is) just so I can delete shapefiles that are no longer open in ArcMap but are locked up because of these silly lock files. I'm not a programmer but was there no other way that this could have been handled? With everything that software can do nowadays is there not some way to simply remove a lock file once the file is no longer opened?

                      Back to my first question, is there a work around for this?

                      Sue