Table of ContentsLibraryView in Frames

Writing a WAFL file

Data ONTAP enables you to read data from standard input and write it into the specified file.


Attention: A user who has the capability to execute the wrfile command can write over or append to any file on the storage system. Exercise caution about security and data corruption issues when using the wrfile command.


  1. Enter the following command: wrfile [-a] filename [...]

    filename is the name of the file you want to write or append to. It must be a fully qualified path name. If filename does not already exist, the wrfile command will create it.

    The -a option appends the rest of the command line after filename to the file. If the -a option is not used, the wrfile command closes the file when it reads an EOF from the input stream or, if run on the console, when interrupted by the interrupt character.
    Note: There are restrictions for using the -a option with special characters, # (hash), ` (backtick), and " (double quotation marks). In general, if you use the -a option, surround the line to be written with quotes.

    The interrupt character is Ctrl-C. If wrfile is run from the console, interrupting wrfile causes all characters typed on the same line as the interrupt character to be lost. The storage system will also issue an "interrupted system call" error message.

Example wrfile command

The following example uses wrfile to create a file /etc/test that contains two lines, "line#1" and "#line#2".
toaster> wrfile /etc/test
Press Enter, followed by the interrupt character.
read: error reading standard input: Interrupted system call
toaster> wrfile -a /etc/test "line#2"

See the na_wrfile(1) man page for additional examples.

Related tasks
Reading a WAFL file