[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

N.10 Operaciones misceláneas con archivos

Emacs has commands for performing many other operations on files. All operate on one file; they do not accept wildcard file names.

M-x view-file allows you to scan or read a file by sequential screenfuls. It reads a file name argument using the minibuffer. After reading the file into an Emacs buffer, view-file displays the beginning. You can then type SPC to scroll forward one windowful, or DEL to scroll backward. Various other commands are provided for moving around in the file, but none for changing it; type ? while viewing for a list of them. They are mostly the same as normal Emacs cursor motion commands. To exit from viewing, type q. The commands for viewing are defined by a special major mode called View mode.

A related command, M-x view-buffer, views a buffer already present in Emacs. @xref{Misc Buffer}.

M-x insert-file (also C-x i) inserts a copy of the contents of the specified file into the current buffer at point, leaving point unchanged before the contents and the mark after them.

M-x write-region is the inverse of M-x insert-file; it copies the contents of the region into the specified file. M-x append-to-file adds the text of the region to the end of the specified file. @xref{Accumulating Text}.

M-x delete-file deletes the specified file, like the rm command in the shell. If you are deleting many files in one directory, it may be more convenient to use Dired (see section Dired, the Directory Editor).

M-x rename-file reads two file names old and new using the minibuffer, then renames file old as new. If the file name new already exists, you must confirm with yes or renaming is not done; this is because renaming causes the old meaning of the name new to be lost. If old and new are on different file systems, the file old is copied and deleted.

The similar command M-x add-name-to-file is used to add an additional name to an existing file without removing its old name. The new name is created as a "hard link" to the existing file. The new name must belong on the same file system that the file is on. On Windows, this command works only if the file resides in an NTFS file system. On MS-DOS, it works by copying the file.

M-x copy-file reads the file old and writes a new file named new with the same contents. Confirmation is required if a file named new already exists, because copying has the consequence of overwriting the old contents of the file new.

M-x make-symbolic-link reads two file names target and linkname, then creates a symbolic link named linkname, which points at target. The effect is that future attempts to open file linkname will refer to whatever file is named target at the time the opening is done, or will get an error if the name target is not in use at that time. This command does not expand the argument target, so that it allows you to specify a relative name as the target of the link.

Confirmation is required when creating the link if linkname is in use. Note that not all systems support symbolic links; on systems that don't support them, this command is not defined.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Roberto on abril, 2 2007 using texi2html 1.76.