Does UES lock files when opened?

Does UES lock files when opened?

29
Basic UserBasic User
29

    Nov 08, 2017#1

    We are noticing that UES (UEStudio '16 Windows 10 64-bit) may be locking files when they are opened.

    When we open a file on a network share (J:\myfile.txt) and then on the server try to overwrite the file (e.g. with COPY) we get:

    The process cannot access the file because it is being used by another process.
            0 file(s) copied.

    As soon as we close the file in UES the problem goes away. We are not technically "editing" the file - we have made no changes and are just viewing it.

    When does UES decide to lock?

    Is there any way to efficiently manage this? I.e. late locking? 

    6,688587
    Grand MasterGrand Master
    6,688587

      Nov 08, 2017#2

      A file is opened with a write lock if being opened without usage of a temporary file. Large files with more than 50 MB are opened without a temporary file with default settings. The appropriate settings for temporary files usage can be found at Advanced - Settings or Configuration - File handling - Temporary files.

      Further there is the setting Lock file for write while editing at Advanced - Settings or Configuration - File handling - Miscellaneous. This setting is not checked by default. But if this setting is enabled, every opened file is locked for write access by other applications.

      Please note that UltraEdit is a text editor and not a text viewer. Applications like file manager Total Commander with built-in listener to just view files are usually a better choice for just viewing files instead of an editor. The listener of Total Commander is available as free stand-alone application for people who just need a simple viewer for any type of file of any size.
      Best regards from an UC/UE/UES for Windows user from Austria

      79
      Advanced UserAdvanced User
      79

        Nov 08, 2017#3

        I wonder if the "Read-only" setting for the file might help?  The OP can maybe try opening the file as "Read-only" (in the File/Open dialog click the down-arrow on the "Open" button to choose "Open as read-only", use the "Edit/Read-only" menu item, or click on the "R/W"/"R/O" gizmo in the status bar at the bottom of the UES window to toggle the state.  Perhaps UES will release the write lock in such a scenario?

        And if that doesn't work, it seems like it would be a reasonable feature request.

        6,688587
        Grand MasterGrand Master
        6,688587

          Nov 09, 2017#4

          A late locking working by first opening any file always without a write lock and later on first modification establish the write lock is not really possible from a object-oriented program code point of view. It is not impossible, but it would be hard to implement and would have a negative effect on performance.

          More easier to implement without a negative effect on performance would be the suggestion of mwb1100 to open a file with File - Open with enabled option Open as read-only always without a write lock even if the file is opened without usage of a temporary file or when the write lock setting is enabled. When the user later decides to toggle off read-only mode, the read-only opened file could be closed and re-opened this time with write lock. Disabling read-only mode would be in this case refused by UltraEdit if the large file has to be re-opened without usage of a temporary file or the file should be opened now with a write lock independent on file size and this is not possible because another application has the file already opened with a write lock. Otherwise the switch from read-only mode to editable mode would be permitted by UltraEdit.

          But such a special file handling for files opened via File - Open using Open as read-only option or from command line with using command line parameter /r is not supported at the moment by UE v24.20.0.44 and UES v17.20.0.15. So this enhancement have to be requested by email to IDM support by a group of users.
          Best regards from an UC/UE/UES for Windows user from Austria