append-buffer - Write contents of buffer to end of named file
n append-buffer "file-name"
append-buffer is used to write the contents of the current buffer into an EXISTING file. Use save-buffer(2) if the buffer is to over-write the existing file already associated with the buffer. Use write-buffer(2) if the buffer is to be written out to a new file, or to replace an existing file.
append-buffer writes the contents of the current buffer to the named file file-name. But unlike write-buffer(2) the action of the write does not change the attributes associated with the file (if it exists), it also does not effect the stats of the current buffer.
On writing the file, append-buffer ignores the time(2m) and backup(2m) mode settings. The current buffer will not be time stamped and a backup will not be created for "file-name". If the buffer contains a narrow(2m) it will automatically be removed before saving so that the whole buffer is saved and restored when saving is complete
The argument n is a bit based flag, where:-
0x01
0x02
0x04
If n is not specified then the default argument of 1 is used.
The following example appends the current buffer onto the end of a file, creating the file if it does not exists
append-buffer "things_to_do.txt"
The following example truncates the users email file while maintaining the file attributes. This is taken from vm(3) where it is used to remove the current mail from the system mail box.
find-buffer "*vm-empty-buffer" -1 buffer-mode "ctrlz" 5 append-buffer %vm-mail-src delete-buffer $buffer-bname
Note that the macro ensures that ctrlz(2m) mode is removed. If it was enabled then the file written would not be empty.
(c) Copyright JASSPA 1999
Last Modified: 1999/08/16
Generated On: 1999/12/01