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

33787Re: Config Vim not to change directory timestamp

Expand Messages
  • Roboco Sanchez
    Oct 4, 2003
    • 0 Attachment
      --- Gary Johnson <garyjohn@...> wrote:
      > On 2003-10-03, Bram Moolenaar <Bram@...>
      > wrote:
      > > Roboco Sanchez wrote:
      > >
      > > > Vim shouldn't change the timestamp of the
      > directory in
      > > > which the file it's saving resides. Vim is the
      > only
      > > > editor to do so. It's really annoyance when you
      > modify
      > > > a file but your directory timestamp is also
      > changed.
      > > > No, I'm not talking about swap file or backup
      > file.
      > > > I'm talking about the directory NNNN that Vim
      > creates
      > > > before saving the file and deletes just after
      > the file
      > > > is saved. So "set backupdir" or "set directory"
      > > > wouldn't help. Please introduce "set secretdir"
      > for
      > > > that NNN directory or just create it in the path
      > of
      > > > "set backupdir" or "set directory". Many thanks.
      > >
      > > I have no idea what you are talking about. Vim
      > doesn't create a
      > > directory next to the file it writes.
      > >
      > > Anyway, if you write a file it's not strange that
      > the directory it
      > > contains is changed. You can avoid this by
      > letting Vim overwrite the
      > > original file (reset 'backup' and 'writebackup')
      > but you risk loosing
      > > your work if the power drops that moment. On Unix
      > the directory is
      > > still changed anyway, since the timestamp of the
      > file is updated.
      >
      > The file's timestamp is kept in the inode, not in
      > the directory, so
      > changing a file's contents should not affect the
      > directory.
      >
      > If I have
      >
      > set nobackup
      > set nowritebackup
      > set noswapfile
      >
      > in my ~/.vimrc, and I use vim to modify a file, the
      > directory time
      > stamp is not changed. (This is using vim-6.2 on
      > HP-UX 10.20.)
      >
      > I have no idea what this "NNN directory" could be,
      > either. Some
      > plugin?
      >
      > Gary
      >
      > --
      > Gary Johnson | Agilent Technologies
      > garyjohn@... | Wireless Division
      > | Spokane, Washington,
      USA

      You solution does solve the problem of directory
      timestamp but you won't have the backup file in your
      backup dir. I would still want both swapfile and
      backupfile as normal.

      Vim does create a dir named NNNN where N is a decimal
      digit even though you use "set backupdir" to tell Vim
      to write backup file somewhere else. If you use
      Windows you can use Sysinternals' FileMon to monitor
      Vim's disk activities and you'll see the real name of
      the dir I'm talking about. On *NIX I'm not sure what
      tool to use.

      Cheers,
      Robo.


      __________________________________
      Do you Yahoo!?
      The New Yahoo! Shopping - with improved product search
      http://shopping.yahoo.com
    • Show all 18 messages in this topic