View Single Post
  #7   (View Single Post)  
Old 24th February 2020
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

I don't know why vi does it the way it does ... but FWIW here's my thinking about it.

If all backup files were put in the same directory (say, the top level ~/.vi/backup directory) then there could be collisions between the backups of files with the same name that originate in different directories, e.g.,

dir1/file and dir2/file

In an attempt to mitigate this problem, vi could create the necessary sub-directories. However, a little thought shows this will not solve all possible collision problems. So maybe they want the user to create these directories so they can be aware of and manage the potential issues?

That's all just a guessing on my part, and I haven't thought it through further than that. Quite possible there's another or better reason for how it works.
Reply With Quote