Menu

#749 Script files could be locked

3.5
closed-fixed
scripting (4)
5
2015-06-05
2015-05-14
Yu Tang
No

Script files (for Scripting) are being locked the most time by OmegaT (at least under Windows).
This makes editing scripts by external editor (Notepad, IntelliJ IDEA or anything) difficult while OmegaT is running.
I think that the lock-free approach would be a good for script-coders (incl. me).

Discussion

  • Kos Ivantsov

    Kos Ivantsov - 2015-05-14

    FYI, they are not locked under Linux

    --
    Kos

     
  • Didier Briel

    Didier Briel - 2015-05-14

    Are you sure they are locked?

    Under Windows, the issue may be "simply" because the default script folder is in Program Files, in which it is forbidden to edit a file.

    My script folder is somewhere else, and I don't remember having a script locked.

    Didier

     
  • Yu Tang

    Yu Tang - 2015-05-14

    Kos, thank you for the input.
    It seems I run into a platform dependent issue. :(
    I tried run OmT with Oracle JRE7 and JRE8 but both gave me the same result.
    Sometimes I can save my script changes in the external editor first time, but I rarely can save it 2nd time.

    Didier, my script folder is always inside OmegaT user profile folder.
    If you don't remember having a script locked, maybe my PC settings has something wrong.

     
  • Didier Briel

    Didier Briel - 2015-05-14

    I managed to reproduce it, at least partially. What I did:
    - ren scripta.groovy to test.groovy (no problem, and there is no more a scripta.groovy)
    - ren test.groovy to scripta.groovy (message telling me the file is locked)

    I don't think the lock is intentional, perhaps more a consequence of the directory monitoring.

    Didier

     
  • Yu Tang

    Yu Tang - 2015-05-14

    Didier, thank you for the time.
    Yes, that is what I encountered.

    I should revise my first post.

    Notepad, IntelliJ IDEA or anything

    Actually, there seems be the matter of chemistry/compatibility with editors.
    Notepad.exe seems be almost fine.
    But my main editor Mery (http://www.haijin-boys.com/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8) almost failed to save changes with OmegaT running situation.
    Also jEdit (https://sourceforge.net/projects/jedit/) has the same issue in this area.
    I can save my changes in jEdit once, but failed to save 2nd time.

    I don't think the lock is intentional, perhaps more a consequence of the directory monitoring.

    I don't know if this should be called a bug. Feel free change the category if you feel it fit to.

     
  • Briac Pilpré

    Briac Pilpré - 2015-05-14

    I commited a possible fix for this issue. Apparently the script could be kept locked by the scanner used for reading the title/description of the script.
    Since I didn't manage to get the scripts locked every time before, I'm not sure this fix releases all the locks, but at least, I can't reproduce the problem now.

     
  • Yu Tang

    Yu Tang - 2015-05-15

    Briac, Thank you! Now I can save my changes as many times as desired with my editor. That's nice. :)

     
  • Yu Tang

    Yu Tang - 2015-05-15
    • status: open --> open-fixed
    • assigned_to: Briac Pilpré
     
  • Didier Briel

    Didier Briel - 2015-05-15
    • summary: Lock-free approach for script files --> Script files could be locked
     
  • Didier Briel

    Didier Briel - 2015-05-15

    Ticket moved from /p/omegat/feature-requests/1090/

     
  • Didier Briel

    Didier Briel - 2015-05-15

    I have moved to bugs and edited the title for clarity.

    Didier

     

    Last edit: Didier Briel 2015-05-15
  • Didier Briel

    Didier Briel - 2015-06-05
    • status: open-fixed --> closed-fixed
    • Group: 3.4 --> 3.5
     
  • Didier Briel

    Didier Briel - 2015-06-05

    Fixed in the released version 3.5 of OmegaT.

    Didier

     

Log in to post a comment.