# view-file(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

view-file - Load a file read only

## SYNOPSIS

n view-file "file-name" (C-x C-v)

## DESCRIPTION

view-file is like find-file(2), and either finds the file in a buffer, or creates a new buffer and reads the file in. A new file is left in view(2m) mode if the file was found (i.e. cannot be edited).

The numeric argument n can be used to modify the default behaviour of the command, where the bits are defined as follows:

0x01

If the file does not exist and this bit is not set the command fails at this point. If the file does not exist and this bit is set (or no argument is specified as the default argument is `1`) then a new empty buffer is created with the given file name, saving the buffer subsequently creates a new file.

0x02

If this bit is set the file will be loaded with binary(2m) mode enabled. See help on binary mode for more information on editing binary data files.

0x04

If this bit is set the file will be loaded with crypt(2m) mode enabled. See help on crypt mode for more information on editing encrypted files.

0x08

If this bit is set the file will be loaded with rbin(2m) mode enabled. See help on rbin mode for more information on efficient editing of binary data files.

0x10

If this bit is set then the file hook evaluation is not performed when the file is loaded (i.e. the buffer's file hook is not executed).

## SEE ALSO

buffer-mode(2), find-file(2), read-file(2), view(2m), binary(2m), crypt(2m), rbin(2m), browse(3).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>