Map Object Name into File Name

DESCRIPTION:

Maps an object name into a file name.

USAGE:

true.file.name(what, where=1, write=T, purpose=0) 

REQUIRED ARGUMENTS:

what
the (character string) name that has been, or is to be, used for an S object in a directory database.

OPTIONAL ARGUMENTS:

where
the database to be used. This can be either a numeric position in the search list (>0 and <= length(search())), or the name of the database in the search list.
write
if TRUE, a mapping of the name will be performed regardless of whether the object exists. Otherwise, an empty string is returned if the mapping is not yet defined.
purpose
the type of database the file is to be written into. Type 0 for an ordinary database, 1 for a methods meta-database, or 2 for a documentation database.

VALUE:

the character string that is the name of the file corresponding to what in the directory. If what is not a legal file name (e.g., too long or containing characters not allowed, or conflicting with special names used by S-PLUS), the resulting character string will be constructed by S-PLUS. Currently it is made up of two underline characters plus a number.

WARNING:

The character string returned should be used very carefully. If you're not sure whether you ought to be working at this low level, chances are you shouldn't be. In particular, moving or removing files of this name is dangerous because it can break S-PLUS's understanding of the corresponding database.

EXAMPLES:

  "T/d" <- 999 
  true.file.name("T/d") 
[1] "__1"