Lock file naming patternWhat does the tilde (~) mean at the end of a filename?bulk rename (or correctly...

Controversial area of mathematics

What do the phrase "Reeyan's seacrest" and the word "fraggle" mean in a sketch?

Stop and Take a Breath!

How exactly does Hawking radiation decrease the mass of black holes?

How to stop co-workers from teasing me because I know Russian?

French for 'It must be my imagination'?

Using a Lyapunov function to classify stability and sketching a phase portrait

How to reduce LED flash rate (frequency)

Is there a way to get a compiler for the original B programming language?

Was there a shared-world project before "Thieves World"?

How to creep the reader out with what seems like a normal person?

What is the relationship between spectral sequences and obstruction theory?

Why other Westeros houses don't use wildfire?

Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?

Why do games have consumables?

Shrinkwrap tetris shapes without scaling or diagonal shapes

simple conditions equation

Was there a Viking Exchange as well as a Columbian one?

Packing rectangles: Does rotation ever help?

How much cash can I safely carry into the USA and avoid civil forfeiture?

Sci fi novel series with instant travel between planets through gates. A river runs through the gates

Is there any limitation with Arduino Nano serial communication distance?

What does the "ep" capability mean?

Why does nature favour the Laplacian?



Lock file naming pattern


What does the tilde (~) mean at the end of a filename?bulk rename (or correctly display) files with special charactersUnix file naming conventionWhat is the file-naming convention for regular text files?Lock Parted Magic?Disallowing blank space in file system namingLibreOffice introducing random page breaksWhy are certain naming conventions so inconsistent in Linux?How to stop opening a file in LibreOffice from changing folder's Date ModifiedKernighan and Pike challenge: how to put a slash in a filename?Why flock doesn't clean the lock file?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following:



.~lock.MyDocument.odt# 


Is this a LibreOffice specific naming pattern? Is it common on Linux?
Why do LibreOffice use exactly that pattern? Why did they choose those specific extra characters?










share|improve this question




















  • 1





    It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

    – ctrl-alt-delor
    17 hours ago


















2















Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following:



.~lock.MyDocument.odt# 


Is this a LibreOffice specific naming pattern? Is it common on Linux?
Why do LibreOffice use exactly that pattern? Why did they choose those specific extra characters?










share|improve this question




















  • 1





    It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

    – ctrl-alt-delor
    17 hours ago














2












2








2








Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following:



.~lock.MyDocument.odt# 


Is this a LibreOffice specific naming pattern? Is it common on Linux?
Why do LibreOffice use exactly that pattern? Why did they choose those specific extra characters?










share|improve this question
















Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following:



.~lock.MyDocument.odt# 


Is this a LibreOffice specific naming pattern? Is it common on Linux?
Why do LibreOffice use exactly that pattern? Why did they choose those specific extra characters?







filenames libreoffice lock






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 17 hours ago









Rui F Ribeiro

42.5k1485146




42.5k1485146










asked 18 hours ago









SilicomancerSilicomancer

1256




1256








  • 1





    It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

    – ctrl-alt-delor
    17 hours ago














  • 1





    It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

    – ctrl-alt-delor
    17 hours ago








1




1





It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

– ctrl-alt-delor
17 hours ago





It is not a Linux thing (Linux is just a kernel). It may be a Unix, Gnu thing.

– ctrl-alt-delor
17 hours ago










2 Answers
2






active

oldest

votes


















2














The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.



The tilde is an unusual character in file names, so there's not much risk of colliding the file name chosen by the user. Why a tilde? Tildes are especially unusual at the beginning of file names, because a leading ~ means “home directory” in shells and many other programs. So prepending a tilde is unlikely to cause a collision. A possible additional factor because when it's at the end of a file name, it's a traditional way to name backups, so adding a tilde to a file's name has a flavor of “some file that is related to this other file, but is not the one the user usually wants” (but it couldn't be at the end because that's already taken). The tilde may additionally have been inspired by the lock files used by Microsoft Office, which start with ~$.



The hash at the end ensures that the file doesn't have an extension that other programs would recognize. If the file was called .~lock.MyDocument.odt, file managers would offer to open it in LibreOffice. Why a hash rather than some other character? Hash has a small tradition of being used in lock file names, for example Emacs uses .# followed by the name of the file that's being edited.






share|improve this answer































    2














    If a program uses a lock file for anything, it is up to the program to choose the name of that lock file.



    The name chosen by LibreOffice seems to be a hidden name constructed in such a way that it's unlikely to collide with a pre-existing filename, while still being specific to whatever document you are currently editing.






    share|improve this answer
























    • So while the "." obviously hides the file the "~" and the "#" are arbitrary?

      – Silicomancer
      17 hours ago






    • 1





      @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

      – Kusalananda
      17 hours ago






    • 1





      @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

      – Kusalananda
      17 hours ago












    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f515839%2flock-file-naming-pattern%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.



    The tilde is an unusual character in file names, so there's not much risk of colliding the file name chosen by the user. Why a tilde? Tildes are especially unusual at the beginning of file names, because a leading ~ means “home directory” in shells and many other programs. So prepending a tilde is unlikely to cause a collision. A possible additional factor because when it's at the end of a file name, it's a traditional way to name backups, so adding a tilde to a file's name has a flavor of “some file that is related to this other file, but is not the one the user usually wants” (but it couldn't be at the end because that's already taken). The tilde may additionally have been inspired by the lock files used by Microsoft Office, which start with ~$.



    The hash at the end ensures that the file doesn't have an extension that other programs would recognize. If the file was called .~lock.MyDocument.odt, file managers would offer to open it in LibreOffice. Why a hash rather than some other character? Hash has a small tradition of being used in lock file names, for example Emacs uses .# followed by the name of the file that's being edited.






    share|improve this answer




























      2














      The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.



      The tilde is an unusual character in file names, so there's not much risk of colliding the file name chosen by the user. Why a tilde? Tildes are especially unusual at the beginning of file names, because a leading ~ means “home directory” in shells and many other programs. So prepending a tilde is unlikely to cause a collision. A possible additional factor because when it's at the end of a file name, it's a traditional way to name backups, so adding a tilde to a file's name has a flavor of “some file that is related to this other file, but is not the one the user usually wants” (but it couldn't be at the end because that's already taken). The tilde may additionally have been inspired by the lock files used by Microsoft Office, which start with ~$.



      The hash at the end ensures that the file doesn't have an extension that other programs would recognize. If the file was called .~lock.MyDocument.odt, file managers would offer to open it in LibreOffice. Why a hash rather than some other character? Hash has a small tradition of being used in lock file names, for example Emacs uses .# followed by the name of the file that's being edited.






      share|improve this answer


























        2












        2








        2







        The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.



        The tilde is an unusual character in file names, so there's not much risk of colliding the file name chosen by the user. Why a tilde? Tildes are especially unusual at the beginning of file names, because a leading ~ means “home directory” in shells and many other programs. So prepending a tilde is unlikely to cause a collision. A possible additional factor because when it's at the end of a file name, it's a traditional way to name backups, so adding a tilde to a file's name has a flavor of “some file that is related to this other file, but is not the one the user usually wants” (but it couldn't be at the end because that's already taken). The tilde may additionally have been inspired by the lock files used by Microsoft Office, which start with ~$.



        The hash at the end ensures that the file doesn't have an extension that other programs would recognize. If the file was called .~lock.MyDocument.odt, file managers would offer to open it in LibreOffice. Why a hash rather than some other character? Hash has a small tradition of being used in lock file names, for example Emacs uses .# followed by the name of the file that's being edited.






        share|improve this answer













        The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.



        The tilde is an unusual character in file names, so there's not much risk of colliding the file name chosen by the user. Why a tilde? Tildes are especially unusual at the beginning of file names, because a leading ~ means “home directory” in shells and many other programs. So prepending a tilde is unlikely to cause a collision. A possible additional factor because when it's at the end of a file name, it's a traditional way to name backups, so adding a tilde to a file's name has a flavor of “some file that is related to this other file, but is not the one the user usually wants” (but it couldn't be at the end because that's already taken). The tilde may additionally have been inspired by the lock files used by Microsoft Office, which start with ~$.



        The hash at the end ensures that the file doesn't have an extension that other programs would recognize. If the file was called .~lock.MyDocument.odt, file managers would offer to open it in LibreOffice. Why a hash rather than some other character? Hash has a small tradition of being used in lock file names, for example Emacs uses .# followed by the name of the file that's being edited.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 16 hours ago









        GillesGilles

        550k13111201634




        550k13111201634

























            2














            If a program uses a lock file for anything, it is up to the program to choose the name of that lock file.



            The name chosen by LibreOffice seems to be a hidden name constructed in such a way that it's unlikely to collide with a pre-existing filename, while still being specific to whatever document you are currently editing.






            share|improve this answer
























            • So while the "." obviously hides the file the "~" and the "#" are arbitrary?

              – Silicomancer
              17 hours ago






            • 1





              @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

              – Kusalananda
              17 hours ago






            • 1





              @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

              – Kusalananda
              17 hours ago
















            2














            If a program uses a lock file for anything, it is up to the program to choose the name of that lock file.



            The name chosen by LibreOffice seems to be a hidden name constructed in such a way that it's unlikely to collide with a pre-existing filename, while still being specific to whatever document you are currently editing.






            share|improve this answer
























            • So while the "." obviously hides the file the "~" and the "#" are arbitrary?

              – Silicomancer
              17 hours ago






            • 1





              @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

              – Kusalananda
              17 hours ago






            • 1





              @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

              – Kusalananda
              17 hours ago














            2












            2








            2







            If a program uses a lock file for anything, it is up to the program to choose the name of that lock file.



            The name chosen by LibreOffice seems to be a hidden name constructed in such a way that it's unlikely to collide with a pre-existing filename, while still being specific to whatever document you are currently editing.






            share|improve this answer













            If a program uses a lock file for anything, it is up to the program to choose the name of that lock file.



            The name chosen by LibreOffice seems to be a hidden name constructed in such a way that it's unlikely to collide with a pre-existing filename, while still being specific to whatever document you are currently editing.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 17 hours ago









            KusalanandaKusalananda

            144k18268449




            144k18268449













            • So while the "." obviously hides the file the "~" and the "#" are arbitrary?

              – Silicomancer
              17 hours ago






            • 1





              @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

              – Kusalananda
              17 hours ago






            • 1





              @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

              – Kusalananda
              17 hours ago



















            • So while the "." obviously hides the file the "~" and the "#" are arbitrary?

              – Silicomancer
              17 hours ago






            • 1





              @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

              – Kusalananda
              17 hours ago






            • 1





              @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

              – Kusalananda
              17 hours ago

















            So while the "." obviously hides the file the "~" and the "#" are arbitrary?

            – Silicomancer
            17 hours ago





            So while the "." obviously hides the file the "~" and the "#" are arbitrary?

            – Silicomancer
            17 hours ago




            1




            1





            @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

            – Kusalananda
            17 hours ago





            @Silicomancer Yes, they are prepended and appended to the name of your file and it creates a filename that is unlikely to exist.

            – Kusalananda
            17 hours ago




            1




            1





            @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

            – Kusalananda
            17 hours ago





            @Silicomancer They are arbitrary, but not random, meaning LibreOffice will always name lock files in this way (as will OpenOffice I believe).

            – Kusalananda
            17 hours ago


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f515839%2flock-file-naming-pattern%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

            Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

            Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...