Display Files

DESCRIPTION:

Display one or more files. The S-PLUS function page() is used to display the files.

USAGE:

file.show(..., header="", title="Splus Information", delete.file=FALSE,
          pager=options("pager"))

OPTIONAL ARGUMENTS:

...
character vectors containing the names of files to display.
header
character vector containing a header for each file in .... The length of this vector should equal the number files being displayed.
title
character string to be used as the overall title. The default is "Splus Information."
delete.file
a logical value. If TRUE, then delete all files after displaying them. The default value is FALSE.
pager
a character string naming the pager to use. The default is value of the S-PLUS pager option, options("pager"). The pager must be a program that can accept a file name as an argument. For more information, see the help file for .

VALUE:

The returned value is the value returned by the call to page() which is the exit status of the pager.

SIDE EFFECTS:

Files included in the ... arguments will be deleted after being displayed if delete.file=TRUE.

DETAILS:

This function displays the concatenation of the specified files with an optional header shown at the beginning of a file. This function is very similar to the page function, but it allows multiple files to be displayed.

This function emulates the R function file.show.

SEE ALSO:

, , .

EXAMPLES:

files <- c(file.path(getenv("SHOME"), c("Copyright", "VERSION")))
file.show(files, header = c("--- S-PLUS Copyright ---",
    "--- S-PLUS VERSION ---"), pager="cat")

cat(file="LETTERS.txt", LETTERS, fill=40)
cat(file="letters.txt", letters, fill=40)
file.show("LETTERS.txt", "letters.txt", header = c("UPPERCASE", "lowercase"))
file.show("LETTERS.txt", "letters.txt", header = c("UPPERCASE", "lowercase"),
        pager = "od --format xz")
file.remove("LETTERS.txt", "letters.txt")