Home AMX User Forum NetLinx Studio

Sharing violation

I had a very strange thing happen the other day that I have never seen before. After spending a long day working on a module, I was just about to close everything for the evening when I got a dialog box in NS that said something about a sharing violation. Behind the dialog I could see the file in NS was blank. I tried to open the file from Windows Explorer, but then got the same error but using the standard Windows dialog rather than the NS dialog. I had to close NS to get at the file, but it was zeroed out. The days work lost, I tired in vain to see if NS made a backup but I couldn't find anything. I am guessing the error was from the Windows API but I am wondering if NS somehow caused this or if its all Windows fault. Has anyone seen this error with NS?
Paul

Comments

  • DHawthorneDHawthorne Posts: 4,584
    I've seen things like this happen when a program crashes and the file permissions never got updated, so Windows thinks they are still open in the program, even though it crashed and terminated. So it's both Windows and NS. Usually, rebooting the PC will clear the flags. I would strongly recommend turning on auto-save in NS. It might not prevent it from happening, but you will know there is a problem before too much time is lost.
  • a_riot42a_riot42 Posts: 1,624
    DHawthorne wrote: »
    I've seen things like this happen when a program crashes and the file permissions never got updated, so Windows thinks they are still open in the program, even though it crashed and terminated. So it's both Windows and NS. Usually, rebooting the PC will clear the flags. I would strongly recommend turning on auto-save in NS. It might not prevent it from happening, but you will know there is a problem before too much time is lost.

    A reboot didn't help unfortunately. I used to use autosave, but it burned me a few times so I turned it off. I use CVS for versioning but typically only commit once a day since I have never seen this problem before and that was all that was necessary. I think from now on I will commit after any substantial changes have been made.
    Paul
  • DHawthorneDHawthorne Posts: 4,584
    The ownership flags on the files must have got scrambled and the system doesn't think you are authorized to access them. It's also possible there are some persistent problems with the file making it appear to the OS as in-use.

    There are some commands you can apply manually to take over ownership, but I find the easiest way is this little registry tweak that adds it to the context menu: http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/ . This automates the process for you and I have used it to good effect many times.

    As for the in-use flag being permanently set, you might try this utility: http://www.addictivetips.com/windows-tips/fix-can-not-delete-access-is-denied-file-in-use-error-in-windows-7-64-bit-os/ .
Sign In or Register to comment.