ServerFileSystem Objects

This encapsulates the functionality for representing the file system on the data mining server's host.

s.createTemporaryFile(name) : ServerFile

name (string) : the suggested name of the new file

Creates a new file with a unique name in the server's temporary file space. The file is empty and can be written by the creator. The specified name will be used as the starting point for generating a unique name for the file, and if the name has an extension it will be left unchanged. The file must be deleted when it is no longer needed.

Exceptions:

ServerResourceException : if the file cannot be created for any reason

s.deleteFile(file)

file (ServerFile) : the file to delete

Deletes the specified file from this file system. The caller must have permission to delete the file.

Calling this method has the same effect as creating and running a delete file task.

Exceptions:

ServerResourceException : if the file cannot be deleted

s.directoryOrFileExists(path, isDirectory) : boolean

path (ServerFile) : Pathname to check

isDirectory (boolean) : Set to True if the path to be tested should be a directory

Returns whether a directory or file exists.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.exists(file) : boolean
file (ServerFile) : 

Returns whether a file exists.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getAbsolutePath(file) : string

file (ServerFile) : a ServerFile object

Returns the absolute pathname or None if the absolute path cannot be determined.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getAbsoluteServerFile(file) : ServerFile

file (ServerFile) : a ServerFile object

Returns a file representing the absolute pathname or None if the absolute path cannot be determined.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getChild(parent, filename) : ServerFile

parent (ServerFile) : a ServerFile object representing a directory or special folder

filename (string) : a name of a file or folder which exists in parent

Returns the named child in the supplied parent.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getDefaultDirectory() : ServerFile

Returns the server's default directory.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getFiles(directory) : ServerFile[]

directory (ServerFile) : the directory

Returns the list of files in the specified directory of the file system.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getParentDirectory(file) : ServerFile

file (ServerFile) : a ServerFile object

Returns the parent directory of a file in the file system.

s.getPathSeparator() : string

Returns a string version of the path separator character.

s.getPathSeparatorChar() : char

Returns the path separator character for this file system. On Windows, this is ; and on UNIX, this is :.

s.getRoots() : ServerFile[]

Returns the roots of the file system.

Exceptions:

ServerResourceException : if the server file system cannot be accessed

s.getSeparator() : string

Returns a string version of the separator character.

s.getSeparatorChar() : char

Returns the separator character for this file system. On Windows, this is \ and on UNIX, this is /.

s.getServerFile(filename) : ServerFile

filename (string) : a name of a file or folder

Returns a server file for the corresponding file name.

s.getSize(file) : long

file (ServerFile) : the file

Returns the size, in bytes, of the specified file in this file system. Returns 0 if the file does not exist or is not accessible, or -1 if the file is accessible but the server does not support the file size operation. The result is undefined when the file denotes a directory.

Exceptions:

ServerResourceException : if the file system cannot be accessed