Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.11
 Overview   Namespace   Class   Index   Help 

Global Functions in Global Namespace C++
in Sourcefile file.h


osl_abbreviateSystemPath
extern "C"
oslFileError osl_abbreviateSystemPath(
rtl_uString * ustrSystemPath,
rtl_uString * * pustrCompacted,
sal_uInt32 uMaxWidth,
oslCalcTextWidthFunc pCalcWidth );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Abbreviates a system notation path

Parameters
ustrSystemPath[in]
the full system path to abbreviate
    
pustrCompacted[out]
receives the compacted system path on output
    
pfnCalcWidth[in]
function ptr that calculates the width of a string. Can be zero.
    
uMaxWidth[in]
maximum width allowed that is retunrned from pfnCalcWidth. 
            If pfnCalcWidth is zero the character count is assumed as width.

    
Return
osl_File_E_None on success otherwise one osl_File_E_INVAL

    
See Also
oslCalcTextWidthFunc

osl_acquireDirectoryItem
extern "C"
oslFileError osl_acquireDirectoryItem(
oslDirectoryItem Item );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Increases the refcount of a directory item handle

Parameters
Item
a handle received by a call to <code>osl_getDirectoryItem</code>, <code>osl_getNextDirectoryItem</code>.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_INVAL        the format of the parameters was not valid<p>

See Also
osl_getDirectoryItem
osl_getNextDirectoryItem
osl_releaseDirectoryItem

osl_acquireVolumeDeviceHandle
extern "C"
oslFileError osl_acquireVolumeDeviceHandle(
oslVolumeDeviceHandle Handle );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES


osl_automountVolumeDevice
extern "C"
oslFileError osl_automountVolumeDevice(
oslVolumeDeviceHandle Handle );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES


osl_closeDirectory
extern "C"
oslFileError osl_closeDirectory(
oslDirectory Directory );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Releases a directory handle

Parameters
Directory
a handle received by a call to <code>osl_openDirectory</code>.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <p>

These errorcodes can (eventually) be returned:<p>
osl_File_E_BADF            Invalid oslDirectory parameter<br>
osl_File_E_INTR            function call was interrupted<p>

See Also
osl_openDirectory

osl_closeFile
extern "C"
oslFileError osl_closeFile(
oslFileHandle Handle );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Closes an open file.
Parameters
Handle
Handle to a file previously open by a call to <code>osl_openFile</code>.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<p>

These errorcodes can (eventually) be returned:<p>    
osl_File_E_BADF            Bad file<br>
osl_File_E_INTR            function call was interrupted<br>
osl_File_E_NOLINK        Link has been severed<br>
osl_File_E_NOSPC        No space left on device<br>
osl_File_E_IO            I/O error<p>

osl_copyFile
extern "C"
oslFileError osl_copyFile(
rtl_uString * strPath,
rtl_uString * strDestPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Copies a file to a new destination. Copies only files not directories. No assumptions should
be made about preserving attributes or file time.
Parameters
strPath
Full qualified UNC path of the source file.
strDestPath
Full qualified UNC path of the destination file. A directory is
NOT a valid destination file !
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_ACCES        Permission denied<br>
osl_File_E_PERM            Operation not permitted<br>
osl_File_E_NAMETOOLONG    File name too long<br>
osl_File_E_NOENT        No such file or directory<br>
osl_File_E_ISDIR        Is a directory<br>
osl_File_E_ROFS            Read-only file system<p>

See Also
osl_moveFile
osl_removeFile
osl_createDirectory

osl_createDirectory
extern "C"
oslFileError osl_createDirectory(
rtl_uString * strPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Creates a directory.
Parameters
strPatg
Full qualified UNC path of the directory to create.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_EXIST        File exists<br>
osl_File_E_ACCES        Permission denied<br>
osl_File_E_NAMETOOLONG    File name too long<br>
osl_File_E_NOENT        No such file or directory<br>
osl_File_E_NOTDIR        Not a directory<br>
osl_File_E_ROFS            Read-only file system<br>
osl_File_E_NOSPC        No space left on device<br>
osl_File_E_DQUOT        Quota exceeded<p>

These errorcodes can (eventually) be returned:<p>
osl_File_E_LOOP            Too many symbolic links encountered<br>
osl_File_E_FAULT        Bad address<br>
osl_FileE_IO            I/O error<br>
osl_File_E_MLINK        Too many links<br>
osl_File_E_MULTIHOP        Multihop attempted<br>
osl_File_E_NOLINK        Link has been severed<p>

See Also
osl_removeDirectory

osl_getAbsoluteFileURL
extern "C"
oslFileError osl_getAbsoluteFileURL(
rtl_uString * strDirBase,
rtl_uString * strRelative,
rtl_uString * * strAbsolute );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Converts a path relative to a given directory into an full qualified UNC path.

Parameters
strDirBase
Base directory to which the relative path is related to.
strRelative[in]
Path of a file or directory relative to the directory path
specified by <code>strDirBase</code>.
strAbsolute
On success it receives the full qualified UNC path of the
requested relative path.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_NOTDIR        Not a directory<br>
osl_File_E_ACCES        Permission denied<br>
osl_File_E_NOENT        No such file or directory<br>
osl_File_E_NAMETOOLONG    File name too long<p>


These errorcodes can (eventually) be returned:<p>
osl_File_E_OVERFLOW        Value too large for defined data type<p>
osl_File_E_FAULT        Bad address<br>
osl_File_E_INTR            function call was interrupted<br>
osl_File_E_LOOP            Too many symbolic links encountered<br>
osl_File_E_MULTIHOP        Multihop attempted<br>
osl_File_E_NOLINK        Link has been severed<p>

See Also
osl_getFileStatus

osl_getCanonicalName
extern "C"
oslFileError osl_getCanonicalName(
rtl_uString * strRequested,
rtl_uString * * strValid );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Determines a valid unused canonical name for a requested name. Depending on file system and operation system
the illegal characters are replaced by valid ones. If a file or directory with the requested name
already exists a new name is generated following the common rules on the actual file system and
operating system.

Parameters
strRequested
Requested name of a file or directory.
strValid
On success receives a name which is unused and valid on the actual operating system and
file system.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>

See Also
osl_getFileStatus

osl_getDirectoryItem
extern "C"
oslFileError osl_getDirectoryItem(
rtl_uString * strFilePath,
oslDirectoryItem * pItem );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Retrieves a single directory item handle with an initial refcount of 1.

Parameters
strFilePath
absolute file path following the notation explained in the documentation for
    <code>osl_openDirectory</code>. Due to performance issues it is not recommended to use this function
    while enumerating the contents of a directory. In this case use <code>osl_getNextDirectoryItem</code> instead.
    
pItem
on success it receives a handle which can be used for subsequent calls to <code>osl_getFileStatus</code>.
    The handle has to be released by a call to <code>osl_releaseDirectoryItem</code>.
    
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_ACCES        permission denied<br>
    osl_File_E_MFILE        too many open files used by the process<br>
    osl_File_E_NFILE        too many open files in the system<br>
    osl_File_E_NOENT        No such file or directory<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_NAMETOOLONG    File name too long<br>
    osl_File_E_NOTDIR        A component of the path prefix of path is not a directory<p>
    
    These errorcodes can (eventually) be returned:<p>
    osl_File_E_IO            I/O error<br>
    osl_File_E_MULTIHOP        Multihop attempted<br>
    osl_File_E_NOLINK        Link has been severed<br>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_INTR            function call was interrupted<p>


    
See Also
osl_releaseDirectoryItem
osl_acquireDirectoryItem
osl_getFileStatus
osl_getNextDirectoryItem

osl_getFilePos
extern "C"
oslFileError osl_getFilePos(
oslFileHandle Handle,
sal_uInt64 * pPos );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Retrieves the current position of the internal pointer of an open file.
Parameters
Handle
Handle to an open file.
pPos
On Success it receives the current position of the file pointer.
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_OVERFLOW        The resulting file offset would be a value which cannot
be represented correctly for regular files<p>

See Also
osl_openFile
osl_setFilePos
osl_readFile
osl_writeFile

osl_getFileStatus
extern "C"
oslFileError osl_getFileStatus(
oslDirectoryItem Item,
oslFileStatus * pStatus,
sal_uInt32 uFieldMask );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Retrieves information about a single file or directory

Parameters
Item
a handle received by a previous call to <code>osl_getDirectoryItem</code>,
    <code>osl_getNextDirectoryItem</code>.
    
pStatus
points to a structure which receives the information of the file or directory
    represented by the handle <code>Item</code>. The member <code>uStructSize</code> has to be initialized to
    <code>sizeof(oslFileStatus)</code> before calling this function.
    
uFieldMask
specifies which fields of the structure pointed to by <code>pStatus</code>
    are of interest to the caller.

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_ACCES        Permission denied<br>
    osl_File_E_NOENT        No such file or directory<br>
    osl_File_E_NAMETOOLONG    file name too long<p>

    These errorcodes can (eventually) be returned:<p> 
    osl_File_E_BADF            Invalid oslDirectoryItem parameter<br>
    osl_File_E_FAULT         Bad address<br>
    osl_File_E_OVERFLOW        Value too large for defined data type<br>
    osl_File_E_INTR            function call was interrupted<br>
    osl_File_E_NOLINK        Link has been severed<br>
    osl_File_E_MULTIHOP        Components of path require hopping to multiple remote machines and the file system does not allow it<br>
    osl_File_E_MFILE        too many open files used by the process<br>
    osl_File_E_NFILE        too many open files in the system<br>
    osl_File_E_NOSPC        No space left on device<br>
    osl_File_E_NXIO            No such device or address<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_NOSYS        Function not implemented<p>

    
See Also
osl_getDirectoryItem
osl_getNextDirectoryItem
oslFileStatus

osl_getFileURLFromSystemPath
extern "C"
oslFileError osl_getFileURLFromSystemPath(
rtl_uString * ustrSystemPath,
rtl_uString * * pustrFileURL );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Converts a system dependend path into a FileURL

Parameters
dir[in]
System dependent path of a file or directory
    
strPath[out]
On success it receives the file URL

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>

    
See Also
osl_getSystemPathFromFileURL

osl_getNextDirectoryItem
extern "C"
oslFileError osl_getNextDirectoryItem(
oslDirectory Directory,
oslDirectoryItem * pItem,
sal_uInt32 uHint );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Retrieves the next item(s) of a previously openend directory. All handles have an initial
refcount of 1.

Parameters
Directory
is the directory handle received from a previous call to <code>osl_openDirectory</code>.
pItem
On success it receives a handle that can be used for subsequent calls to <code>osl_getFileStatus</code>.
The handle has to be released by a call to <code>osl_releaseDirectoryItem</code>.
uHint
With this parameter the caller can tell the implementation that (s)he
is going to call this function uHint times afterwards. This enables the implementation to
get the information for more than one file and cache it until the next calls.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_NOENT        No more entries in this directory<p>

These errorcodes can (eventually) be returned:<p>
osl_File_E_BADF            oslDirectory parameter is not valid<br>
osl_File_E_OVERFLOW        Value too large for defined data type<p>

See Also
osl_releaseDirectoryItem
osl_acquireDirectoryItem
osl_getDirectoryItem
osl_getFileStatus

osl_getSystemPathFromFileURL
extern "C"
oslFileError osl_getSystemPathFromFileURL(
rtl_uString * ustrFileURL,
rtl_uString * * pustrSystemPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Converts a file URL in a system dependend path

Parameters
dir[in]
File URL
    
strPath[out]
On success it receives the system dependent path of a file or a directory

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>

    
See Also
osl_getFileURLFromSystemPath

osl_getVolumeDeviceMountPath
extern "C"
oslFileError osl_getVolumeDeviceMountPath(
oslVolumeDeviceHandle Handle,
rtl_uString * * pstrPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Gets the normalized absolute file system path where a device is mounted to.

Parameters
Handle
Device handle of the volume retrieved with <code>osl_getVolumeInformation</code>.
    
pstrPath
Receives the path where the device is mounted to.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_ACCES        permission denied<br>
    osl_File_E_NXIO            No such device or address<br>
    osl_File_E_NODEV        No such device<br>
    osl_File_E_NOENT        No such file or directory<br>

    These errorcodes can (eventually) be returned:<p>
    osl_File_E_FAULT        Bad address<br>
    osl_FilE_E_INTR            function call was interrupted<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_MULTIHOP        Multihop attempted<br>
    osl_File_E_NOLINK        Link has been severed<br>
    osl_File_E_EOVERFLOW    Value too large for defined data type<p>

    
See Also
osl_getVolumeInformation
osl_automountVolumeDevice
osl_unmountVolumeDevice

osl_getVolumeInformation
extern "C"
oslFileError osl_getVolumeInformation(
rtl_uString * strDirectory,
oslVolumeInfo * pInfo,
sal_uInt32 uFieldMask );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Retrieves information about a volume. A volume can either be a mount point, a network
resource or a drive depending on operating system and file system. Before calling this
function <code>osl_getFileStatus</code> should be called to determine if the type is
<code>osl_file_Type_Volume</code>.

Parameters
strDirectory
Full qualified UNC path to the volume
pInfo
On success it receives information about the volume.
uFieldMask
Specifies which members of the structure should be filled
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_INVAL        the format of the parameters was not valid<p>

These errorcodes can (eventually) be returned:<p>
osl_File_E_NOTDIR        Not a directory<br>
osl_File_E_NAMETOOLONG    File name too long<br>
osl_File_E_NOENT        No such file or directory<br>
osl_File_E_ACCES        permission denied<br>
osl_File_E_LOOP            Too many symbolic links encountered<br>
ols_File_E_FAULT        Bad address<br>
osl_File_E_IO            I/O error<br>
osl_File_E_NOSYS        Function not implemented<br>
osl_File_E_MULTIHOP        Multihop attempted<br>
osl_File_E_NOLINK        Link has been severed<br>
osl_File_E_INTR            function call was interrupted<p>

See Also
osl_getFileStatus
oslVolumeInfo

osl_isEndOfFile
extern "C"
oslFileError osl_isEndOfFile(
oslFileHandle Handle,
sal_Bool * pIsEOF );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Tests if the end of a file is reached.

Parameters
Handle
Handle to an open file.
    
pIsEOF
Points to a variable that receives the end of file
    status.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>

    These errorcodes can (eventually) be returned:<p>
    osl_File_E_INTR            function call was interrupted<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_ISDIR        Is a directory<br>
    osl_File_E_BADF            Bad file<br>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_AGAIN        Operation would block<br>
    osl_File_E_NOLINK        Link has been severed<p>

    
See Also
osl_openFile
osl_readFile
osl_readLine
osl_setFilePos

osl_moveFile
extern "C"
oslFileError osl_moveFile(
rtl_uString * strPath,
rtl_uString * strDestPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Moves a file or directory to a new destination or renames it. File time and attributes
are preserved.
Parameters
strPath
Full qualified UNC path of the source file.
strDestPath
Full qualified UNC path of the destination file. An existing directory
is NOT a valid destination !
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_ACCES        Permission denied<br>
osl_File_E_PERM            Operation not permitted<br>
osl_File_E_NAMETOOLONG    File name too long<br>
osl_File_E_NOENT        No such file or directory<br>
osl_File_E_ROFS            Read-only file system<p>

See Also
osl_copyFile

osl_openDirectory
extern "C"
oslFileError osl_openDirectory(
rtl_uString * strDirectoryPath,
oslDirectory * pDirectory );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Opens a directory for enumerating its contents.     

Parameters
strDirenctoryPath
Denotes the full qualified path of the directory follwing the UNC
    notation. The path devider is '/'. Relative path specifications are not allowed.
    
pDirectory
on success it receives a handle used for subsequent calls by <code>osl_getNextDirectoryItem</code>
    on error it receives NULL. The handle has to be released by a call to <code>osl_closeDirectory</code>.

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOENT        the specified path doesn't exist<br>
    osl_File_E_NOTDIR        the specified path is not an directory <br>
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_ACCES        permission denied<br>
    osl_File_E_MFILE        too many open files used by the process<br>
    osl_File_E_NFILE        too many open files in the system<br>
    osl_File_E_NAMETOOLONG    File name too long<br>
    osl_File_E_LOOP            Too many symbolic links encountered<p>

    
See Also
osl_getNextDirectoryItem
osl_closeDirectory

osl_openFile
extern "C"
oslFileError osl_openFile(
rtl_uString * strPath,
oslFileHandle * pHandle,
sal_uInt32 uFlags );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Opens a file.

Parameters
strPath
Full qualified path to the file to open. Only regular files
    can be openend.
    
pHandle
On success it receives a handle to the open file.
    
uFlags
Specifies the open mode.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NAMETOOLONG    pathname was too long<br>
    osl_File_E_NOENT        No such file or directory<br>
    osl_File_E_ACCES        permission denied<p>
    osl_File_E_AGAIN        A write lock could not be established<p>
    
    These errorcodes can (eventually) be returned:<p>
    osl_File_E_NOTDIR        Not a directory<br>
    osl_File_E_NXIO            No such device or address<br>
    osl_File_E_NODEV        No such device<br>
    osl_File_E_ROFS            Read-only file system<br>
    osl_File_E_TXTBSY        Text file busy<br>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_NOSPC        No space left on device<br>
    osl_File_E_ISDIR        Is a directory<br>
    osl_File_E_MFILE        too many open files used by the process<br>
    osl_File_E_NFILE        too many open files in the system<br>
    osl_File_E_DQUOT        Quota exceeded<br>
    osl_File_E_EXIST        File exists<br>
    osl_FilE_E_INTR            function call was interrupted<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_MULTIHOP        Multihop attempted<br>
    osl_File_E_NOLINK        Link has been severed<br>
    osl_File_E_EOVERFLOW    Value too large for defined data type<p>

    
See Also
osl_closeFile
osl_setFilePos
osl_getFilePos
osl_readFile
osl_writeFile
osl_setFileSize

osl_readFile
extern "C"
oslFileError osl_readFile(
oslFileHandle Handle,
void * pBuffer,
sal_uInt64 uBytesRequested,
sal_uInt64 * pBytesRead );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Reads a number of bytes from a file. The internal file pointer is increased by the number of bytes
read.
Parameters
Handle
Handle to an open file.
pBuffer
Points to a buffer which receives data. The buffer must be large enough
to hold <code>uBytesRequested</code> bytes.
uBytesRequested
Number of bytes which should be retrieved.
pBytesRead
On success the number of bytes which have actually been retrieved.
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>

These errorcodes can (eventually) be returned:<p>
osl_File_E_INTR            function call was interrupted<br>
osl_File_E_IO            I/O error<br>
osl_File_E_ISDIR        Is a directory<br>
osl_File_E_BADF            Bad file<br>
osl_File_E_FAULT        Bad address<br>
osl_File_E_AGAIN        Operation would block<br>
osl_File_E_NOLINK        Link has been severed<p>

See Also
osl_openFile
osl_writeFile
osl_readLine
osl_setFilePos

osl_readLine
extern "C"
oslFileError osl_readLine(
oslFileHandle Handle,
sal_Sequence * * ppSequence );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Reads a line from given file. The new line delemeter(s) are NOT returned!

Parameters
Handle
Handle to an open file.
    
ppSequence
a pointer to a valid sequence. Will hold the line read on return.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>

    These errorcodes can (eventually) be returned:<p>
    osl_File_E_INTR            function call was interrupted<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_ISDIR        Is a directory<br>
    osl_File_E_BADF            Bad file<br>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_AGAIN        Operation would block<br>
    osl_File_E_NOLINK        Link has been severed<p>

    
See Also
osl_openFile
osl_readFile
osl_writeFile
osl_setFilePos

osl_releaseDirectoryItem
extern "C"
oslFileError osl_releaseDirectoryItem(
oslDirectoryItem Item );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Decreases the refcount of a directory item handle and releases the data if the
refcount reaches 0.

Parameters
Item
a handle received by a call to <code>osl_getDirectoryItem</code>, <code>osl_getNextDirectoryItem</code>.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_NOMEM        not enough memory for allocating structures <br>
osl_File_E_INVAL        the format of the parameters was not valid<p>

See Also
osl_getDirectoryItem
osl_getNextDirectoryItem
osl_acquireDirectoryItem
osl_acquireDirectoryItem

osl_releaseVolumeDeviceHandle
extern "C"
oslFileError osl_releaseVolumeDeviceHandle(
oslVolumeDeviceHandle Handle );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES


osl_removeDirectory
extern "C"
oslFileError osl_removeDirectory(
rtl_uString * strPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Removes an empty directory.

Parameters
strPath
Full qualified UNC path of the directory.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_PERM            Operation not permitted<br>
    osl_File_E_ACCES        Permission denied<br>
    osl_File_E_NOENT        No such file or directory<br>
    osl_File_E_NOTDIR        Not a directory<br>
    osl_File_E_NOTEMPTY        Directory not empty<p>

    These errorcodes can (eventually) be returned:<p>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_NAMETOOLONG    File name too long<br>
    osl_File_E_BUSY            Device or resource busy<br>
    osl_File_E_ROFS            Read-only file system<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_BUSY            Device or resource busy<br>
    osl_File_E_EXIST        File exists<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_MULTIHOP        Multihop attempted<br>
    osl_File_E_NOLINK        Link has been severed<p>

    
See Also
osl_createDirectory

osl_removeFile
extern "C"
oslFileError osl_removeFile(
rtl_uString * strPath );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Removes (erases) a regular file.

Parameters
strPath
Full qualified UNC path of the directory.
    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOMEM        not enough memory for allocating structures <br>
    osl_File_E_ACCES        Permission denied<br>
    osl_File_E_PERM            Operation not permitted<br>
    osl_File_E_NAMETOOLONG    File name too long<br>
    osl_File_E_NOENT        No such file or directory<br>
    osl_File_E_ISDIR        Is a directory<br>
    osl_File_E_ROFS            Read-only file system<p>
    
    These errorcodes can (eventually) be returned:<p>
    osl_File_E_FAULT        Bad address<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_IO            I/O error<br>
    osl_File_E_BUSY            Device or resource busy<br>
    osl_File_E_INTR            function call was interrupted<br>
    osl_File_E_LOOP            Too many symbolic links encountered<br>
    osl_File_E_MULTIHOP        Multihop attempted<br>
    osl_File_E_NOLINK        Link has been severed<br>
    osl_File_E_TXTBSY        Text file busy<p>

osl_searchFileURL
extern "C"
oslFileError osl_searchFileURL(
rtl_uString * ustrFileName,
rtl_uString * ustrSearchPath,
rtl_uString * * pustrFileURL );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Searches a full qualified UNC-Path/File 

Parameters
filePath[in]
System dependent path / Normalized Path / File-URL or file or relative directory 
    
searchPath[in]
Paths, in which a given file has to be searched. These paths are only for the search of a
    file or a relative path, otherwise it will be ignored. If it is set to NULL or while using the
    search path the search failed the function searches for a matching file in all system directories and in the directories
    listed in the PATH environment variable
    
strPath[out]
On success it receives the full qualified UNC path

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOTDIR        Not a directory<br>
    osl_File_E_NOENT        No such file or directory not found<br>
    
See Also
osl_normalizePath

osl_setFileAttributes
extern "C"
oslFileError osl_setFileAttributes(
rtl_uString * filePath,
sal_uInt64 uAttributes );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Sets file-attributes  

Parameters
filePath[in]
Path of the file
    
uAttributes[in]
Attributes of the file to be set

    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    
See Also
osl_getFileStatus

osl_setFilePos
extern "C"
oslFileError osl_setFilePos(
oslFileHandle Handle,
sal_uInt32 uHow,
sal_Int64 uPos );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Sets the internal position pointer of an open file.
Parameters
Handle
Handle of an open file received by a previous call to <code>osl_openFile</code>.
uHow
Distance to move the internal position pointer (from uPos).
uPos
Absolute position from the beginning of the file.
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_OVERFLOW        The resulting file offset would be a value which cannot
be represented correctly for regular files<p>

See Also
osl_openFile
osl_getFilePos

osl_setFileSize
extern "C"
oslFileError osl_setFileSize(
oslFileHandle Handle,
sal_uInt64 uSize );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Sets the file size of an open file. The file can be truncated or enlarged by the function.
The position of the file pointer is not affeced by this function.
Parameters
Handle
Handle to an open file.
uSize
New size in bytes.
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_OVERFLOW        The resulting file offset would be a value which cannot
be represented correctly for regular files<p>

See Also
osl_openFile
osl_setFilePos
osl_getFileStatus

osl_setFileTime
extern "C"
oslFileError osl_setFileTime(
rtl_uString * filePath,
TimeValue * aCreationTime,
TimeValue * aLastAccessTime,
TimeValue * aLastWriteTime );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Sets file-Time 

Parameters
filePath[in]
Path of the file 
    
aCreationTime[in]
creation time of the given file
    
aLastAccessTime[in]
time of the last access of the given file
    
aLastWriteTime[in]
time of the last modifying of the given file


    
Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
    osl_File_E_INVAL        the format of the parameters was not valid<br>
    osl_File_E_NOENT        No such file or directory not found<br>
    
See Also
osl_getFileStatus

osl_unmountVolumeDevice
extern "C"
oslFileError osl_unmountVolumeDevice(
oslVolumeDeviceHandle Handle );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES


osl_writeFile
extern "C"
oslFileError osl_writeFile(
oslFileHandle Handle,
const void * pBuffer,
sal_uInt64 uBytesToWrite,
sal_uInt64 * pBytesWritten );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Writes a number of bytes to a file. The internal file pointer is increased by the number of bytes
read.
Parameters
Handle
Handle to an open file.
pBuffer
Points to a buffer which contains the data.
uBytesToWrite
Number of bytes which should be written.
pBytesWritten
On success the number of bytes which have actually been written.

Return
osl_File_E_None on success otherwise one of the following errorcodes:<p> 
osl_File_E_INVAL        the format of the parameters was not valid<br>
osl_File_E_FBIG            File too large<br>
osl_File_E_DQUOT        Quota exceeded<p>

These errorcodes can (eventually) be returned:<p>
osl_File_E_AGAIN        Operation would block<br>
osl_File_E_BADF            Bad file<br>
osl_File_E_FAULT        Bad address<br>
osl_File_E_INTR            function call was interrupted<br>
osl_File_E_IO            I/O error<br>
osl_File_E_NOLCK        No record locks available<br>
osl_File_E_NOLINK        Link has been severed<br>
osl_File_E_NOSPC        No space left on device<br>
osl_File_E_NXIO            No such device or address<p>

See Also
osl_openFile
osl_readFile
osl_setFilePos

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.