Make a New Directory Database

DESCRIPTION:

Make a new directory that S-PLUS can attach as a database.

USAGE:

new.database(where=<<see below>>, type="directory",
             platform.=platform())

REQUIRED ARGUMENTS:

where
the name of a directory. By default this will be ".Data". If the directory exists it will be filled in with some auxiliary files that S-PLUS requires in an attached directory.

OPTIONAL ARGUMENTS:

type
a character string giving the type of database. Currently it must be "directory" (the default).
platform.
a character string giving the S-PLUS code for the type of computer S-PLUS will be running on when it attaches the new database. It defaults to the current computer's code. Setting this to "WIN386" when running under Unix will create a database that can be used under both Windows and Unix.

VALUE:

the name of the directory database.

SIDE EFFECTS:

The named directory will be created if it does not exist and the following subdirectories created within it:

Windows

__Hhelp, __Meta, __Shelp, ___nonfi, __prev, and __init.

UNIX
__Hhelp, __Meta, __Shelp, and ___nonfile

The __prev and __init subdirectories are used to support the undo function and store the previous and initial versions of a data set. The __*help and __Meta directories store help files and methods metadata, respectively. ___nonfi (Windows) and ___nonfile (Unix) are files that store mappings between S-PLUS object names and their associated file names in .Data.

DETAILS:

The key difference between the database created for use on a Unix platform versus Windows is the file ___nonfile (Unix) or ___nonfi (Windows). The presence of the ___nonfi file indicates that S-PLUS should respect the Windows file naming convention which results in more S-PLUS object names being mapped to file names of the form __n where n is an integer. For example, the S-PLUS object with name .FunnyName will may get stored in the file __17. The mappings between object name and file name are stored in the ___nonfi or ___nonfile file.

SEE ALSO:

, , , .

EXAMPLES:

# To make a workspace that you can throw away at the end of
# a session do
work.dir <- tempfile()
attach(pos=1, new.database(work.dir))
# At the end of the session copy what you like from
# where=1 to where=2 then detach and remove that workspace with
detach(1)
rmdir(work.dir)