Preserving bookmarks in moved files

Preserving bookmarks in moved files

9
NewbieNewbie
9

    Mar 29, 2010#1

    Do you know if it is possible to move a file to a different directory and preserve the bookmarks that have been defined in that file?

    I know that you can do it by opening the file in UE and then saving it into the new location, but that process can be cumbersome
    when dealing with several files. What I am looking for is an easier way to move possibly even a batch of files while still maintaining
    their bookmarks.

    6,603548
    Grand MasterGrand Master
    6,603548

      Mar 30, 2010#2

      Text files cannot contain hidden data like binary Word documents. Therefore which lines of a file are bookmarked is saved in uedit32.ini or the workspace/project file of a project.

      I think it is clear now that what you want is not possible. If you move a file from directory A to directory B with Windows Explorer, it is impossible for UltraEdit to know what you have done with another application and change the path of the file in uedit32.ini or the workspace/project file accordingly to preserve the bookmark data for that file.

      UltraEdit saves the file name always with full path because there could be several files with identical names in different directories, index.html typically exists in many directories of a website project. So just saving the bookmark data only with name of file without path is not really possible.
      Best regards from an UC/UE/UES for Windows user from Austria

      236
      MasterMaster
      236

        Mar 30, 2010#3

        Just as a thought: Couldn't UE use alternate data streams to store metainformation like bookmarks? Of course, it would only work on local NTFS drives, but if that restriction is made clear, it would be a way to make text files contain "hidden information".

        A problem might be that users probably don't know that the ADS will be lost when they copy their file to a USB drive or a network drive (unless they use a file manager that alerts them of this).

        9
        NewbieNewbie
        9

          Mar 30, 2010#4

          I understand that text files cannot contain hidden data, unless the data is in ADS as pietzcker suggested.
          What I had in mind is a way to copy/move files from inside of UE so that UE would be aware of the location change.
          I tried doing that using the "explorer" window from UE but it did not allow me to move files around.

          6,603548
          Grand MasterGrand Master
          6,603548

            Mar 31, 2010#5

            I hope, the text editor UltraEdit will never become file managing capabilities including even simply ones like copy and move. UltraEdit is and should be a text editor and not a file manager. I'm quite sure that when UltraEdit supports ever copying, moving and deleting of files, the next user wants also support for creating directories to be able to copy or move files into not yet existing directories and then the next users surely start requesting more and more special file managing features with the result of wanting a Windows version dependent Windows Explorer inside UltraEdit with FTP / SFTP support. Therefore I hope that UltraEdit will never come with file managing commands.

            You can write a script which saves all open files into a new directory you enter into a getString() dialog. That would result in copying the files to a new directory with keeping the bookmarks. The script has to remember the full path of all opened files in a string array before saving them into a different directory using saveAs() command. Furthermore you would need to configure a user tool containing with the command line del "%sel%". After saving all opened files into a new directory, the script would need to temporarily open a new file and run a loop in which one file name after the other is written into this new file, reselected by using selectToTop() and calling the user tool to delete the file. The problem is that the bookmark data for the not anymore existing files are still stored forever in uedit32.ini.

            Another solution would be to move the files with your favorite file manager and replace the path of the moved files in %appdata%\IDMComp\UltraEdit\uedit32.ini while UltraEdit is not running for example with Notepad.


            Well, that uedit32.ini contains data for not existing files is a general problem when using saving of bookmarks, saving of code foldings and now with UE v16.00 the line change indicator visibility setting (section [LCI]). Those features have the potential to let the INI file increase and increase and increase making startup of UltraEdit slower and slower and slower. Currently there is only one possibility to avoid this, delete the not needed anymore data in the INI file manually.

            I suggested IDM to save the line change indicator visibility state setting in the Open Files section and therefore remember it only for opened files on closing UltraEdit (or a project) and not for all files ever opened in UltraEdit. But IDM replied that the users which wanted that feature want the setting remembered on a per file base which is bad for users like me using UEStudio for projects and UltraEdit for general text editing on hundreds of different text files, most of them not longer existing on hard disk than 24 hours (or even a few minutes). I also mentioned that clearing history to save privacy is useless when section [LCI] contains a complete history of all files ever opened.

            IDM suggested to delete with the Clear History button in the configuration dialog (Toolbars / Menus - Miscellaneous) also entire section [LCI] and this is done since UE v16.00.0.1036. Using configuration setting Clear recent document/project and search/replace histories on exit has the same affect. Code folding and bookmark data are surely not included in history clearing process.

            I will suggest IDM to implement a button anywhere which can be pressed by the user to test if all files (except files opened via FTP) saved in the bookmarks or code folding data section in uedit32.ini or the workspace file of the current project still exist, and delete the data of not existing files. The problem here are files with UNC paths stored on servers not available at the moment because of the long network timeouts which can result in needing several minutes before this process can finish when not good implemented.


            BTW: I have a batch file on my laptop which maps network drives. The problem is that I use this laptop at work and at home. Therefore I needed a solution to quickly find out in which computers (servers, just other computers) are available in the current LAN if a LAN connection exists at all. My solution:

            %systemroot%\system32\ping.exe -n 1 computername1 >nul
            if errorlevel 1 goto !Comp2

            net use drive letter: \\computername1\share /persistent:no
            net use drive letter: \\computername1\share /persistent:no
            net use drive letter: \\computername1\share /persistent:no

            :!Comp2
            %systemroot%\system32\ping.exe -n 1 computername2 >nul
            if errorlevel 1 goto !Comp3

            and so on

            Using ping command to find out if a server exists avoids the long network timeouts.
            Best regards from an UC/UE/UES for Windows user from Austria

            236
            MasterMaster
            236

              Mar 31, 2010#6

              Very good suggestion Mofi. A "Clean up ini file" command would be very helpful. One little thing to consider (which other editors I won't name here can handle): Files on a USB drive might have a different path every time the drive is inserted because the drive letter may change. So it would be good if UE could track those files even across different drive letters if they are on the same USB drive. (and not remove them from the .ini file simply if it can't open the file under the last-used drive letter).