diff options
| author | Paul Eggert | 2016-09-10 19:12:21 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-09-10 19:14:44 -0700 |
| commit | 31407634f77c9e40bb3c3ca87013672528cffa57 (patch) | |
| tree | 8d153a965452539a8465d9403e333cbe36a97433 | |
| parent | 9b21d9f9110445846dce25c3505c4ee04572fade (diff) | |
| download | emacs-31407634f77c9e40bb3c3ca87013672528cffa57.tar.gz emacs-31407634f77c9e40bb3c3ca87013672528cffa57.zip | |
Document file synchronization issues
* doc/lispref/files.texi (Files and Storage): New section.
| -rw-r--r-- | doc/emacs/files.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/backups.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 25 |
3 files changed, 32 insertions, 2 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index f195a41d542..7bf46908739 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1554,8 +1554,8 @@ delete-file}. @xref{VC Delete/Rename}. | |||
| 1554 | 1554 | ||
| 1555 | @findex copy-file | 1555 | @findex copy-file |
| 1556 | @cindex copying files | 1556 | @cindex copying files |
| 1557 | @kbd{M-x copy-file} reads the file @var{old} and writes a new file | 1557 | @kbd{M-x copy-file} copies the contents of the file @var{old} to the |
| 1558 | named @var{new} with the same contents. | 1558 | file @var{new}. |
| 1559 | 1559 | ||
| 1560 | @findex copy-directory | 1560 | @findex copy-directory |
| 1561 | @kbd{M-x copy-directory} copies directories, similar to the | 1561 | @kbd{M-x copy-directory} copies directories, similar to the |
diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi index b9e6466c871..35a18651488 100644 --- a/doc/lispref/backups.texi +++ b/doc/lispref/backups.texi | |||
| @@ -41,6 +41,11 @@ You can alternatively request numbered backups; then each new backup | |||
| 41 | file gets a new name. You can delete old numbered backups when you | 41 | file gets a new name. You can delete old numbered backups when you |
| 42 | don't want them any more, or Emacs can delete them automatically. | 42 | don't want them any more, or Emacs can delete them automatically. |
| 43 | 43 | ||
| 44 | For performance, the operating system may not write the backup | ||
| 45 | file's contents to secondary storage immediately, or may alias the | ||
| 46 | backup data with the original until one or the other is later | ||
| 47 | modified. @xref{Files and Storage}. | ||
| 48 | |||
| 44 | @menu | 49 | @menu |
| 45 | * Making Backups:: How Emacs makes backup files, and when. | 50 | * Making Backups:: How Emacs makes backup files, and when. |
| 46 | * Rename or Copy:: Two alternatives: renaming the old file or copying it. | 51 | * Rename or Copy:: Two alternatives: renaming the old file or copying it. |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 0aea1dfd9a3..b912d7bc8f5 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -41,6 +41,7 @@ to locale @code{system-messages-locale}, and decoded using coding system | |||
| 41 | simultaneous editing by two people. | 41 | simultaneous editing by two people. |
| 42 | * Information about Files:: Testing existence, accessibility, size of files. | 42 | * Information about Files:: Testing existence, accessibility, size of files. |
| 43 | * Changing Files:: Renaming files, changing permissions, etc. | 43 | * Changing Files:: Renaming files, changing permissions, etc. |
| 44 | * Files and Storage:: Surviving power and media failures | ||
| 44 | * File Names:: Decomposing and expanding file names. | 45 | * File Names:: Decomposing and expanding file names. |
| 45 | * Contents of Directories:: Getting a list of the files in a directory. | 46 | * Contents of Directories:: Getting a list of the files in a directory. |
| 46 | * Create/Delete Dirs:: Creating and Deleting Directories. | 47 | * Create/Delete Dirs:: Creating and Deleting Directories. |
| @@ -1496,6 +1497,10 @@ error if they fail to perform their function, reporting the | |||
| 1496 | system-dependent error message that describes the reason for the | 1497 | system-dependent error message that describes the reason for the |
| 1497 | failure. | 1498 | failure. |
| 1498 | 1499 | ||
| 1500 | For performance, the operating system may cache or alias changes | ||
| 1501 | made by these functions instead of writing them immediately to | ||
| 1502 | secondary storage. @xref{Files and Storage}. | ||
| 1503 | |||
| 1499 | In the functions that have an argument @var{newname}, if a file by the | 1504 | In the functions that have an argument @var{newname}, if a file by the |
| 1500 | name of @var{newname} already exists, the actions taken depend on the | 1505 | name of @var{newname} already exists, the actions taken depend on the |
| 1501 | value of the argument @var{ok-if-already-exists}: | 1506 | value of the argument @var{ok-if-already-exists}: |
| @@ -1794,6 +1799,26 @@ The function returns @code{t} if it successfully sets the ACL of | |||
| 1794 | @var{filename}, @code{nil} otherwise. | 1799 | @var{filename}, @code{nil} otherwise. |
| 1795 | @end defun | 1800 | @end defun |
| 1796 | 1801 | ||
| 1802 | @node Files and Storage | ||
| 1803 | @section Files and Secondary Storage | ||
| 1804 | @cindex secondary storage | ||
| 1805 | |||
| 1806 | After Emacs changes a file, there are two reasons the changes might | ||
| 1807 | not survive later failures of power or media, both having to do with | ||
| 1808 | efficiency. First, the operating system might alias written data with | ||
| 1809 | data already stored elsewhere on secondary storage until one file or | ||
| 1810 | the other is later modified; this will lose both files if the only | ||
| 1811 | copy on secondary storage is lost due to media failure. Second, the | ||
| 1812 | operating system might not write data to secondary storage | ||
| 1813 | immediately, which will lose the data if power is lost. | ||
| 1814 | |||
| 1815 | Although both sorts of failures can largely be avoided by a suitably | ||
| 1816 | configured file system, such systems are typically more expensive or | ||
| 1817 | less efficient. In more-typical systems, to survive media failure you | ||
| 1818 | can copy the file to a different device, and to survive a power | ||
| 1819 | failure you can invoke the @command{sync} utility (@pxref{sync | ||
| 1820 | invocation,,, coreutils, The @sc{gnu} @code{Coreutils} Manual}). | ||
| 1821 | |||
| 1797 | @node File Names | 1822 | @node File Names |
| 1798 | @section File Names | 1823 | @section File Names |
| 1799 | @cindex file names | 1824 | @cindex file names |