Loading ...
Sorry, an error occurred while loading the content.

Strange behavior editing hard links

Expand Messages
  • Rafael Garcia-Suarez
    Try this one: (on UNIX only) touch a ln a b Then, open a with vim, and then try to edit b ( :e b ). Vim (6.0n) keeps a in the buffer. This isn t actually
    Message 1 of 2 , Dec 1, 2000
    • 0 Attachment
      Try this one: (on UNIX only)
      touch a
      ln a b
      Then, open 'a' with vim, and then try to edit 'b' (':e b'). Vim (6.0n)
      keeps 'a' in the buffer. This isn't actually a problem since 'a' and 'b'
      are the same file. But is it a feature or a side-effect?
      --
      Rafael Garcia-Suarez
    • Bram Moolenaar
      ... This is a feature. Vim uses one buffer for two file names linked to the same file. The first name used is mentioned for the buffer. This avoids editing
      Message 2 of 2 , Dec 1, 2000
      • 0 Attachment
        Rafael Garcia-Suarez wrote:

        > Try this one: (on UNIX only)
        > touch a
        > ln a b
        > Then, open 'a' with vim, and then try to edit 'b' (':e b'). Vim (6.0n)
        > keeps 'a' in the buffer. This isn't actually a problem since 'a' and 'b'
        > are the same file. But is it a feature or a side-effect?

        This is a feature. Vim uses one buffer for two file names linked to the same
        file. The first name used is mentioned for the buffer. This avoids editing
        two versions of the same file.

        --
        ARTHUR: Then who is your lord?
        WOMAN: We don't have a lord.
        ARTHUR: What?
        DENNIS: I told you. We're an anarcho-syndicalist commune. We take it in
        turns to act as a sort of executive officer for the week.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.