ssCore.BinaryFile.open

Open an existing file for binary access.


Availability:

First available in version 3.7 build 197.


Input Parameters:

path - A fully qualified path. This parameter supports monikers.

accessMode - [Optional] - Desired file access mode. Valid values include: read,write. Default value is read.

shareMode - [Optional] - Desired file sharing mode. Valid values include: none,read,write. Default value is none.


Output Parameters:

systemError - A system specific error code from the GetLastError function.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.BinaryFile.open( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.BinaryFile.open( paramsObject );


Notes:

Setting the accessMode to "write" automatically includes read access as well.

Use the shareMode parameter to control how the new file should be shared with other processes. A share mode of "none" means that no other process will be able to access the file while this process has it open. A share mode of "read" means that other processes will be able to open the file in read mode, "write" means that other processes will be able to open the file for reading and writing.

                

Examples:

Open a file for read/write access but don't allow other processes any access.

ssCore.BinaryFile.open({path:"startdir://file.txt", accessMode:"write", shareMode:"none"});

Open a file for read/write access and allow other processes read access.

ssCore.BinaryFile.open({path:"startdir://file.txt", accessMode:"write", shareMode:"read"});

Open a file for read/write access and allow other processes read/write access.

ssCore.BinaryFile.open({path:"startdir://file.txt", accessMode:"write", shareMode:"write"});