Disable automatic save is not working with UEX for Linux v21.00.0.0

Disable automatic save is not working with UEX for Linux v21.00.0.0

5
NewbieNewbie
5

    22:17 - Jun 18#1

    I've had this issue for quite some time. I have disabled automatic save because I often work with very large files and I don't want the constant delay that occurs when UEX is trying to update those large files. Unfortunately, this has never worked for me, even when I'm editing small files. If I make a change, especially with things like search and replace, UEX will pop up a message at the top of the screen that says "The file, XXXXX, has changed on disk. Do you want to reload the file?" and includes Yes and No buttons. A check of the file outside of UEX confirms that sure enough, the file was updated.

    Does anyone have any idea what is going on? It seems that UEX is completely ignoring the "Enable automatic save" setting in preferences. Besides the delay, this makes editing annoying because it keeps popping up that message while I'm trying to edit. Is there some other setting I'm missing here? I also have Temp Files disabled (as suggested by UEX as a performance improvement for large files).

    Thanks for the help.

    6,652559
    Grand MasterGrand Master
    6,652559

      5:21 - Jun 19#2

      The message window should never appear if the file modifications are done by UEX. This message window should appear only if the file is opened with usage of a temporary file and another process modified the original opened file detected by UEX on last modification timestamp and file size and file attributes (like read-only on Windows).

      In UltraEdit for Windows the configuration setting File change detection at File handling - File change detection controls the feature detecting a file change on an opened file by another process. This feature can be completely disabled or customized to check for a file change only on the active opened file and not the other opened files, or run the file change detection only on switching back from a different application to UltraEdit.

      Important for working with small and large files is also the configuration at File handling - Large files (UltraEdit for Windows ≥ v2023.1) which is in UEX most likely still File handling - Temporary files. There can be configured which (small) files depending on file size are opened with usage of a temporary file and which (large) files are opened without using a temporary file. Opening a large file without usage of a temporary file is faster but has the disadvantage that every modification is applied immediately on the file and no undo/redo is possible. The large file opened without usage of a temporary file cannot be modified by any other process as long as it is opened by UltraEdit on Windows. That is most likely different on Linux as most Linux file systems do not have a shared file access management as done by the Windows file I/O. I don't have a Linux machine and don't use for that reason UEX. So I cannot tell you how to configure UEX correct for your environment.

      There are other configuration settings which control the behavior on a file save is really done by UEX either triggered by the user with Ctrl+S or automatically on having enabled automatic save and using a temporary file. Those settings are in UltraEdit for Windows at File handling - Advanced. They need to be configured different from the default if the files are stored not on local disk but a remote device mounted using Samba or if files to edit have special permissions not derived from the directory.
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        15:15 - Jun 19#3

        Thanks for the feedback Mofi.

        What you mentioned about the message not appearing if the changes were made by UEX is exactly what is perplexing me. I don't want to disable the file change detection because some of the files I work with certainly could be changed by another process (or even another user). However, in the cases I'm having trouble with, I know for certain that is not what is occurring.

        I should have made it more clear in my original post, but the changes to the file were the edits I had just made, so I know they are coming from UEX. I did some testing where I copied and pasted the first line of the file four times and then waited till the message appeared. Then I checked the file outside UEX (with a viewer, not an editor) and I could see those four lines copied at the top. So UEX had definitely written the changes, but in UEX it still showed the file as not being saved (still had a * on the file tab to show "modified"). 

        So maybe it isn't exactly automatic save that is occurring, since I assume that would remove the * each time to show that the file is not modified anymore. From your description, it sounds like this could be related to the fact that I have temporary files disabled. You mentioned that when they are disabled, it will apply edits immediately. That sounds like exactly what is going on, but this is not what I expect from disabling temp files. I don't want it to apply my changes until I explicitly tell it to save. Applying the changes immediately defeats the purpose of not using temp files (at least my purpose 😉). I'm not trying to avoid long load times, I am trying to avoid long delays that occur every time I make a few changes. If I used temporary files, I assume those delays would still happen, just that it would be updating a temporary file. Also, I'm trying to avoid another copy of the file, since some of these files are massive.

        Do you think that might be what is going on? If so, any thoughts on how I can get it to operate the way I want: no writes to at all until I explicitly hit save?

        I'll do some playing around with temp files while using small files to see if I can confirm some things.

        Thanks again.

        6,652559
        Grand MasterGrand Master
        6,652559

          18:29 - Jun 19#4

          Disabling the usage of temporary files is counterproductive for working for small files. That should be never done for small files, just for large and huge files with 50 or more MB, especially if the files are UTF-8 encoded (variable number of bytes per character).

          Most editors load a file on opening completely into RAM. This approach does not work on opening very large or huge files depending on free available RAM and largest free block currently available. Such editors cannot be used for very large files at all.

          UltraEdit supports two file handling modes: RAM based file handling and disk based file handling

          The most often used mode is the RAM based file handling which is working with usage of a temporary file for small files whereby the user defines with the threshold value what is a small file depending on hardware (amount of installed RAM, speed of storage media, processor speed, etc.) and running processes (number of usually running processes, amount of RAM used usually by those processes respectively amount of usually free RAM, etc.). The usage of a temporary file does not mean that UltraEdit makes just a copy of the original file and now reads/writes every file modification directly to the temporary file. There is instead loaded the temporary file into memory of UltraEdit and the memory is modified with recording also in memory the modifications for undo/redo. From time to time the current content of the file opened with usage of a temporary file is written from memory to the temporary file for special use cases like a crash of UltraEdit or a power loss which avoids a total loss of all unsaved modifications done only in the memory (RAM). The original opened file is updated only on a real file save executed by the user on disabled automatic save.

          The disk based file handling mode does not use a temporary file. UltraEdit processes in this case the original file directly with loading always only chunks of the file for processing. The chuck loaded is around current visible text. Every modification on the loaded chuck is written immediately to the storage media. Well, immediately means here in many cases just after some seconds as saving every character delete/insert to the file would be extremely slow. But when a very large file is opened without usage of a temporary file and a find or a replace is executed from top of the file to bottom of the file, UltraEdit processes the file now as fast as possible by reading a block (=chunk) , searching in the block, making perhaps a modification in the block on running a replace, write back the modification to the file if there is a modification, reads the next block, and so on until the entire file is processed.

          The disk based editing mode makes it possible to edit files of any size with any amount of RAM as long as there is enough free RAM for at least two chunks. The disk based editing mode is sometimes problematic on regular expression replaces where the search expression is complex and requires forward and backward moves in character stream several times and the character stream to process during the regular expression find spreads over two chunks or even more on large blocks to select. Such regular expression finds/replaces can result in false positives, i.e. a character stream is not matched although it should be matched or is just partly matched due to processing the file content in blocks instead of one large character stream.

          I strongly recommend configuring the temporary files usage to open only large files without usage of a temporary file. I use since 25 years 4096 KB as threshold value although the amount of installed RAM increased dramatically in the last 25 years. I have configured to prompt me before opening a file with more than 4 MiB without usage of a temporary file. Sometimes I click on Yes on prompt to open the file in disk based editing mode without usage of a temporary file on opening really a very large file or if I just want to view something in larger file without making a modification. But sometimes I decide with a click on button No for opening the file in RAM based mode with usage of a temporary file if I want to edit it with using undo/redo feature like on running a complex regular expression replace where I first must find out the right expression or when the file is just about 20 MiB and multiple modifications need to be done on the file which are done faster on loading the file completely into RAM.
          Best regards from an UC/UE/UES for Windows user from Austria

          5
          NewbieNewbie
          5

            23:02 - Jun 19#5

            Thanks for the detailed response, this is very helpful towards understanding what is going on. The large files I work with are typically in the 1GB range, so I think disk based is the only option there. I like your suggestion of using prompting so that I can determine whether I want to use temporary files or not when the size is more reasonable. I assume the threshold setting means that it will automatically use temporary files when the size is under the threshold and will prompt me if the size is above the threshold.

            This sounds like a great solution. I don't really use regular expressions much, so I don't think I'll have too much trouble with that functionality.

            I'll update here once I experiment with this setting. Thanks again.

              0:36 - Jun 20#6

              OK, just a quick update. I changed the temporary file handling and things seem to be working well. Smaller files are using the temporary file and I'm no longer getting the prompts about the file changing. My very large files are giving me the prompt. There are still some difficulties with using these extremely large files, but it helps to understand what is going on behind the scenes so I can make decisions on how to handle things.

              One thing I have been using is to change the large files to R/O in UEX as soon as I load them in. That way I don't have to worry about delays if I mistakenly hit a key and make a change. Plus, it allows me to make edits and then change the file to R/W and write those changes. I don't have to make many changes to these huge files, so that seems to be working for me.

              Thanks again for the help.

              6,652559
              Grand MasterGrand Master
              6,652559

                5:13 - Jun 20#7

                I am glad to read about solved issue with unwanted save of small files.

                There is the power tip Large file text editor and viewer which could be interesting for you.

                UltraEdit for Windows v2023.1 introduced a new configuration window named Large files where the user can check or uncheck settings controlling the usage of features which often do not make sense on working with very large files. These are mainly the features described on the power tips page which require parsing the entire file. The difference to UEX 21.00 and UltraEdit for Windows < v2023.1 is that the features a user does not want to use on viewing/editing a large file for more efficiency are disabled only for large files opened without usage of a temporary file while they are still enabled for small files as long as not disabled in configuration entirely as never used by the user. That enhancement is very useful for people using UltraEdit mainly for editing small files and only sometimes for viewing/editing large files as the features which require parsing the entire file can be enabled by default and are just disabled for large files. There is the recording of the webinar Handling 4GB+ Source Code: The Best Editor for Large Files where this enhancement for large file viewing/editing in UltraEdit was presented by UltraEdit, Inc. I suggest to write and send an enhancement request email to UltraEdit support with requesting that enhancement also for next version of UEX. It could be very useful for you and the more UEX users request a feature the higher becomes the priority for being implemented in a future version of UEX.
                Best regards from an UC/UE/UES for Windows user from Austria

                5
                NewbieNewbie
                5

                  14:22 - Jun 20#8

                  Thanks for the tip, I will definitely check those out and send in the request, since working with large files is the main reason I bought UEX.