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.
|