Table of ContentsView in Frames

Writing a WAFL file

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

About this task

A user who has the capability to execute the wrfile command can write over or append data 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, you should enclose the line to be written within quotation marks.

    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 of 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 (Ctrl-c).
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.