

(ctime is not creation date.) Microsoft Windows and Mac OS X do record file creation date.). Note: unixes (including Linux and BSD) do not record file creation date, so this doesn't matter. (If a file is created in 2001, and you modified it today, the file's creation date will become today. Files, To open a new file, save the current editing. And it saves a back up (ending with ) just in case you really screw up. Other buffers may be created during an editing session, for example, when you use the M-x compile function. This effectively destroys the creation date of your file. Until you save the file youre editing, all actions are reversible. (info "(elisp) Backup Files") (info "(emacs) Backup") stop emacs backup changing the file's creation date of the original fileĮxplanation: when emacs does a backup, by default it renames the original file into the backup file name, then create a new file and insert new file content into it. backup at /A/B/.emacs.d/backup/A/B/web/xyz/myfile.txt~.The above will mirror tree structure to the backup dir. ( setq make-backup-file-name-function ' xah-backup-nested-dir-file-path) ( format "%s%s~" $backupRoot ( replace-regexp-in-string "^:/" "" Fpath)))
#Emacs save file driver#
remove Windows driver letter in path, e.g. This effectively destroys the creation date of your file. If the new path's directories does not exist, create them. Explanation: when emacs does a backup, by default it renames the original file into the backup file name, then create a new file and insert new file content into it. ( defun xah-backup-nested-dir-file-path ( Fpath)

Put this in your Emacs Init File: make backup to a designated dir, mirroring the full path (Mac and Windows allow 255 chars for file name.) set backups in one dir with tree structure If you use long file names or many nested dirs, this scheme will reach file name length limit quickly.
