Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


Methods of Class FileBase


getCanonicalName
static RC getCanonicalName(
const ::rtl::OUString & ustrRequestedURL,
::rtl::OUString & ustrValidURL );

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

Summary
Determine a valid unused canonical name for a requested name.
Description
Determines a valid unused canonical name for a requested name. Depending on the Operating System and the File 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 Operating System and File System.
Parameters
ustrRequestedURL
        Requested name of a file or directory.
        
        
pustrValidURL
        On success receives a name which is unused and valid on the actual Operating System and
        File System.

        
Return
E_None on success E_INVAL the format of the parameters was not valid
See Also
DirectoryItem::getFileStatus()

getAbsoluteFileURL
static RC getAbsoluteFileURL(
const ::rtl::OUString & ustrBaseDirectoryURL,
const ::rtl::OUString & ustrRelativeFileURL,
::rtl::OUString & ustrAbsoluteFileURL );

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

Summary
Convert a path relative to a given directory into an full qualified file URL.
Description
Convert a path relative to a given directory into an full qualified file URL. The function resolves symbolic links if possible and path ellipses, so on success the resulting absolute path is fully resolved.
Parameters
ustrBaseDirectoryURL
    Base directory URL to which the relative path is related to.
    
    
ustrRelativeFileURL
    An URL of a file or directory relative to the directory path specified by ustrBaseDirectoryURL
    or an absolute path.
    If ustrRelativeFileURL denotes an absolute path ustrBaseDirectoryURL will be ignored.
    
    
ustrAbsoluteFileURL
    On success it receives the full qualified absoulte file URL.

    
Return
E_None on success E_INVAL the format of the parameters was not valid E_NOMEM not enough memory for allocating structures E_NOTDIR not a directory E_ACCES permission denied E_NOENT no such file or directory E_NAMETOOLONG file name too long E_OVERFLOW value too large for defined data type E_FAULT bad address E_INTR function call was interrupted E_LOOP too many symbolic links encountered E_MULTIHOP multihop attempted E_NOLINK link has been severed
See Also
DirectoryItem::getFileStatus()

getSystemPathFromFileURL
static RC getSystemPathFromFileURL(
const ::rtl::OUString & ustrFileURL,
::rtl::OUString & ustrSystemPath );

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

Summary
Convert a file URL into a system dependend path.
Parameters
ustrFileURL
        A File URL.
        
        
ustrSystemPath
        On success it receives the system path.

        
Return
E_None on success E_INVAL the format of the parameters was not valid
See Also
getFileURLFromSystemPath()

getFileURLFromSystemPath
static RC getFileURLFromSystemPath(
const ::rtl::OUString & ustrSystemPath,
::rtl::OUString & ustrFileURL );

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

Summary
Convert a system dependend path into a file URL.
Parameters
ustrSystemPath
        A System dependent path of a file or directory.
        
        
ustrFileURL
        On success it receives the file URL.

        
Return
E_None on success E_INVAL the format of the parameters was not valid
See Also
getSystemPathFromFileURL()

searchFileURL
static RC searchFileURL(
const ::rtl::OUString & ustrFileName,
const ::rtl::OUString & ustrSearchPath,
::rtl::OUString & ustrFileURL );

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

Summary
Searche a full qualified system path or a file URL.
Parameters
ustrFileName
        A system dependent path, a file URL, a file or relative directory 
        
        
ustrSearchPath
        A list of system paths, in which a given file has to be searched. The Notation of a path list is 
        system dependend, e.g. on UNIX system "/usr/bin:/bin" and on Windows "C:\BIN;C:\BATCH".
        These paths are only for the search of a file or a relative path, otherwise it will be ignored. 
        If ustrSearchPath is 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. 
        The value of an environment variable should be used (e.g. LD_LIBRARY_PATH) if the caller is not 
        aware of the Operating System and so doesn't know which path list delimiter to use.
                               
        
ustrFileURL
        On success it receives the full qualified file URL.

        
Return
E_None on success E_INVAL the format of the parameters was not valid E_NOTDIR not a directory E_NOENT no such file or directory not found
See Also
getFileURLFromSystemPath()
getSystemPathFromFileURL()

getTempDirURL
static RC getTempDirURL(
::rtl::OUString & ustrTempDirURL );

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

Summary
Retrieves the file URL of the system's temporary directory path.
Parameters
ustrTempDirURL[out]
        On success receives the URL of system's    temporary directory path.

        
Return
E_None on success E_NOENT no such file or directory not found

createTempFile
static RC createTempFile(
::rtl::OUString * pustrDirectoryURL,
oslFileHandle * pHandle,
::rtl::OUString * pustrTempFileURL );

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

Description
Creates a temporary file in the directory provided by the caller or the directory returned by getTempDirURL. Under UNIX Operating Systems the file will be created with read and write access for the user exclusively. If the caller requests only a handle to the open file but not the name of it, the file will be automatically removed on close else the caller is responsible for removing the file on success.

Parameters
pustrDirectoryURL
Specifies the full qualified URL where the temporary file should be created. 
If pustrDirectoryURL is 0 the path returned by osl_getTempDirURL will be used.
    
pHandle
On success receives a handle to the open file.
If pHandle is 0 the file will be closed on return, in this case
pustrTempFileURL must not be 0.
    
pustrTempFileURL
On success receives the full qualified URL of the temporary file.
If pustrTempFileURL is 0 the file will be automatically removed
on close, in this case pHandle must not be 0.
If pustrTempFileURL is not 0 the caller receives the name of the
created file and is responsible for removing the file.              

Return
E_None on success E_INVAL the format of the parameter is invalid E_NOMEM not enough memory for allocating structures E_ACCES Permission denied E_NOENT No such file or directory E_NOTDIR Not a directory E_ROFS Read-only file system E_NOSPC No space left on device E_DQUOT Quota exceeded
See Also
getTempDirURL()

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.