/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* * This file is part of LibreOffice published API.
*/
/** Base class for all File System specific objects.
@see Directory @see DirectoryItem @see File
*/
class FileBase
{ public:
enum RC {
E_None = osl_File_E_None, ///< on success
E_PERM = osl_File_E_PERM, ///< operation not permitted
E_NOENT = osl_File_E_NOENT, ///< no such file or directory
E_SRCH = osl_File_E_SRCH, ///< no process matches the PID
E_INTR = osl_File_E_INTR, ///< function call was interrupted
E_IO = osl_File_E_IO, ///< I/O error occurred
E_NXIO = osl_File_E_NXIO, ///< no such device or address
E_2BIG = osl_File_E_2BIG, ///< argument list too long
E_NOEXEC = osl_File_E_NOEXEC, ///< invalid executable file format
E_BADF = osl_File_E_BADF, ///< bad file descriptor
E_CHILD = osl_File_E_CHILD, ///< there are no child processes
E_AGAIN = osl_File_E_AGAIN, ///< resource temp unavailable, try again later
E_NOMEM = osl_File_E_NOMEM, ///< no memory available
E_ACCES = osl_File_E_ACCES, ///< file permissions do not allow operation
E_FAULT = osl_File_E_FAULT, ///< bad address; an invalid pointer detected
E_BUSY = osl_File_E_BUSY, ///< resource busy
E_EXIST = osl_File_E_EXIST, ///< file exists where should only be created
E_XDEV = osl_File_E_XDEV, ///< improper link across file systems detected
E_NODEV = osl_File_E_NODEV, ///< wrong device type specified
E_NOTDIR = osl_File_E_NOTDIR, ///< file isn't a directory where one is needed
E_ISDIR = osl_File_E_ISDIR, ///< file is a directory, invalid operation
E_INVAL = osl_File_E_INVAL, ///< invalid argument to library function
E_NFILE = osl_File_E_NFILE, ///< too many distinct file openings
E_MFILE = osl_File_E_MFILE, ///< process has too many distinct files open
E_NOTTY = osl_File_E_NOTTY, ///< inappropriate I/O control operation
E_FBIG = osl_File_E_FBIG, ///< file too large
E_NOSPC = osl_File_E_NOSPC, ///< no space left on device, write failed
E_SPIPE = osl_File_E_SPIPE, ///< invalid seek operation (such as on pipe)
E_ROFS = osl_File_E_ROFS, ///< illegal modification to read-only filesystem
E_MLINK = osl_File_E_MLINK, ///< too many links to file
E_PIPE = osl_File_E_PIPE, ///< broken pipe; no process reading from other end of pipe
E_DOM = osl_File_E_DOM, ///< domain error (mathematical error)
E_RANGE = osl_File_E_RANGE, ///< range error (mathematical error)
E_DEADLK = osl_File_E_DEADLK, ///< deadlock avoided
E_NAMETOOLONG = osl_File_E_NAMETOOLONG, ///< filename too long
E_NOLCK = osl_File_E_NOLCK, ///< no locks available
E_NOSYS = osl_File_E_NOSYS, ///< function not implemented
E_NOTEMPTY = osl_File_E_NOTEMPTY, ///< directory not empty
E_LOOP = osl_File_E_LOOP, ///< too many levels of symbolic links found during name lookup
E_ILSEQ = osl_File_E_ILSEQ, ///< invalid or incomplete byte sequence of multibyte char found
E_NOLINK = osl_File_E_NOLINK, ///< link has been severed
E_MULTIHOP = osl_File_E_MULTIHOP, ///< remote resource is not directly available
E_USERS = osl_File_E_USERS, ///< file quote system is confused as there are too many users
E_OVERFLOW = osl_File_E_OVERFLOW, ///< value too large for defined data type
E_NOTREADY = osl_File_E_NOTREADY, ///< device not ready
E_invalidError = osl_File_E_invalidError, ///< unmapped error: always last entry in enum!
E_TIMEDOUT = osl_File_E_TIMEDOUT, ///< socket operation timed out
E_NETWORK = osl_File_E_NETWORK
};
public:
/** Determine a valid unused canonical name for a requested name.
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.
@param[in] ustrRequestedURL Requested name of a file or directory.
@param[out] ustrValidURL On success receives a name which is unused and valid on the actual Operating System and File System.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid
/** Convert a path relative to a given directory into an full qualified file URL.
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.
@param[in] ustrBaseDirectoryURL Base directory URL to which the relative path is related to.
@param[in] ustrRelativeFileURL A 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.
@param[out] ustrAbsoluteFileURL On success it receives the full qualified absolute file URL.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_NOTDIR not a directory @retval E_ACCES permission denied @retval E_NOENT no such file or directory @retval E_NAMETOOLONG file name too long @retval E_OVERFLOW value too large for defined data type @retval E_FAULT bad address @retval E_INTR function call was interrupted @retval E_LOOP too many symbolic links encountered @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed
/** Search a full qualified system path or a file URL.
@param[in] ustrFileName A system dependent path, a file URL, a file or relative directory
@param[in] ustrSearchPath A list of system paths, in which a given file has to be searched. The Notation of a path list is system dependent, 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.
@param[out] ustrFileURL On success it receives the full qualified file URL.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOTDIR not a directory @retval E_NOENT no such file or directory not found
/** 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.<br><br>
@param[in] 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.
@param[out] 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.
@param[out] 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.
Description of the different pHandle, ppustrTempFileURL parameter combinations. pHandle is 0 and pustrTempDirURL is 0 - this combination is invalid<br> pHandle is not 0 and pustrTempDirURL is 0 - a handle to the open file will be returned on success and the file will be automatically removed on close<br> pHandle is 0 and pustrTempDirURL is not 0 - the name of the file will be returned, the caller is responsible for opening, closing and removing the file.<br> pHandle is not 0 and pustrTempDirURL is not 0 - a handle to the open file as well as the file name will be returned, the caller is responsible for closing and removing the file.<br>
@retval E_None on success @retval E_INVAL the format of the parameter is invalid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES Permission denied @retval E_NOENT No such file or directory @retval E_NOTDIR Not a directory @retval E_ROFS Read-only file system @retval E_NOSPC No space left on device @retval E_DQUOT Quota exceeded
if ( newHandle )
osl_acquireVolumeDeviceHandle( newHandle );
if ( _aHandle )
osl_releaseVolumeDeviceHandle( _aHandle );
_aHandle = newHandle;
return *this;
}
/** Get the full qualified URL where a device is mounted to.
@return The full qualified URL where the device is mounted to.
*/
rtl::OUString getMountPath()
{
rtl::OUString aPath;
osl_getVolumeDeviceMountPath( _aHandle, &aPath.pData ); return aPath;
}
friendclass VolumeInfo;
};
class Directory;
/** The VolumeInfo class.
Neither copy nor assignment is allowed for this class.
@see Directory::getVolumeInfo
*/
class VolumeInfo
{
oslVolumeInfo _aInfo;
sal_uInt32 _nMask;
VolumeDevice _aDevice;
@param nMask Set of flags for the fields to check.
@return true if all fields are valid else false.
*/ bool isValid( sal_uInt32 nMask ) const
{ return ( nMask & _aInfo.uValidFields ) == nMask;
}
/** Check the remote flag.
@return true if Attributes are valid and the volume is remote else false.
*/ bool getRemoteFlag() const
{ return (_aInfo.uAttributes & osl_Volume_Attribute_Remote) != 0;
}
/** Check the removable flag.
@return true if attributes are valid and the volume is removable else false.
*/ bool getRemoveableFlag() const
{ return (_aInfo.uAttributes & osl_Volume_Attribute_Removeable) != 0;
}
/** Check the compact disc flag.
@return true if attributes are valid and the volume is a CDROM else false.
*/
/** Return whether the file system is case sensitive or case insensitive
@return true if the file system is case sensitive false otherwise
*/ bool isCaseSensitiveFileSystem() const
{ return (_aInfo.uAttributes & osl_Volume_Attribute_Case_Sensitive) != 0;
}
/** Return whether the file system preserves the case of file and directory names or not
@return true if the file system preserves the case of file and directory names false otherwise
*/ bool isCasePreservingFileSystem() const
{ return (_aInfo.uAttributes & osl_Volume_Attribute_Case_Is_Preserved) != 0;
}
friendclass Directory;
};
class DirectoryItem;
/** The FileStatus class.
@see DirectoryItem::getFileStatus
*/
class FileStatus
{
oslFileStatus _aStatus;
sal_uInt32 _nMask;
@return The file type.
*/
Type getFileType() const
{
SAL_INFO_IF(
!isValid(osl_FileStatus_Mask_Type), "sal.osl", "no FileStatus Type determined"); return isValid(osl_FileStatus_Mask_Type)
? static_cast< Type >(_aStatus.eType) : Unknown;
}
/** Is it a directory? This method returns True for both directories, and volumes.
@return True if it's a directory, False otherwise.
@retval E_None on success @retval E_NOMEM not enough memory for allocating structures @retval E_INVAL the format of the parameters was not valid @retval E_NAMETOOLONG pathname was too long @retval E_NOENT no such file or directory @retval E_ACCES permission denied @retval E_AGAIN a write lock could not be established @retval E_NOTDIR not a directory @retval E_NXIO no such device or address @retval E_NODEV no such device @retval E_ROFS read-only file system @retval E_TXTBSY text file busy @retval E_FAULT bad address @retval E_LOOP too many symbolic links encountered @retval E_NOSPC no space left on device @retval E_ISDIR is a directory @retval E_MFILE too many open files used by the process @retval E_NFILE too many open files in the system @retval E_DQUOT quota exceeded @retval E_EXIST file exists @retval E_INTR function call was interrupted @retval E_IO on I/O errors @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed @retval E_EOVERFLOW value too large for defined data type
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_BADF Bad file @retval E_INTR function call was interrupted @retval E_NOLINK link has been severed @retval E_NOSPC no space left on device @retval E_IO on I/O errors
/** Set the internal position pointer of an open file.
@param[in] uHow Distance to move the internal position pointer (from uPos).
@param[in] uPos Absolute position from the beginning of the file.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files
/** Retrieve the current position of the internal pointer of an open file.
@param[out] uPos On success receives the current position of the file pointer.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files
@param[out] pIsEOF Points to a variable that receives the end-of-file status.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_INTR function call was interrupted @retval E_IO on I/O errors @retval E_ISDIR is a directory @retval E_BADF bad file @retval E_FAULT bad address @retval E_AGAIN operation would block @retval E_NOLINK link has been severed
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.
@param[in] uSize New size in bytes.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files
Gets the file size of an open file. The position of the file pointer is not affeced by this function.
@param[out] rSize Current size in bytes.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files
Reads a number of bytes from a file. The internal file pointer is increased by the number of bytes read.
@param[out] pBuffer Points to a buffer which receives data. The buffer must be large enough to hold uBytesRequested bytes.
@param[in] uBytesRequested Number of bytes which should be retrieved.
@param[out] rBytesRead On success the number of bytes which have actually been retrieved.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_INTR function call was interrupted @retval E_IO on I/O errors @retval E_ISDIR is a directory @retval E_BADF bad file @retval E_FAULT bad address @retval E_AGAIN operation would block @retval E_NOLINK link has been severed
Writes a number of bytes to a file. The internal file pointer is increased by the number of bytes read.
@param[in] pBuffer Points to a buffer which contains the data.
@param[in] uBytesToWrite Number of bytes which should be written.
@param[out] rBytesWritten On success the number of bytes which have actually been written.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_FBIG file too large @retval E_DQUOT quota exceeded @retval E_AGAIN operation would block @retval E_BADF bad file @retval E_FAULT bad address @retval E_INTR function call was interrupted @retval E_IO on I/O errors @retval E_NOLCK no record locks available @retval E_NOLINK link has been severed @retval E_NOSPC no space left on device @retval E_NXIO no such device or address
Reads a line from a file. The new line delimiter is NOT returned!
@param[in,out] aSeq A reference to a ::rtl::ByteSequence that will hold the line read on success.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_INTR function call was interrupted @retval E_IO on I/O errors @retval E_ISDIR is a directory @retval E_BADF bad file @retval E_FAULT bad address @retval E_AGAIN operation would block @retval E_NOLINK link has been severed
/** Synchronize the memory representation of a file with that on the physical medium.
The function ensures that all modified data and attributes of the file associated with the given file handle have been written to the physical medium. In case the hard disk has a write cache enabled, the data may not really be on permanent storage when osl_syncFile returns.
@retval E_None On success @retval E_INVAL The value of the input parameter is invalid @retval E_BADF The file is not open for writing @retval E_IO An I/O error occurred @retval E_NOSPC There is no enough space on the target device @retval E_ROFS The file is located on a read only file system @retval E_TIMEDOUT A remote connection timed out. This may happen when a file is on a remote location
Copies a file to a new destination. Copies only files not directories. No assumptions should be made about preserving attributes or file time.
@param[in] ustrSourceFileURL Full qualified URL of the source file.
@param[in] ustrDestFileURL Full qualified URL of the destination file. A directory is NOT a valid destination file!
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_PERM operation not permitted @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file or directory @retval E_ISDIR is a directory @retval E_ROFS read-only file system
/** Move a file or directory to a new destination or renames it.
Moves a file or directory to a new destination or renames it. File time and attributes are preserved.
@param[in] ustrSourceFileURL Full qualified URL of the source file.
@param[in] ustrDestFileURL Full qualified URL of the destination file. An existing directory is NOT a valid destination !
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_PERM operation not permitted @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file or directory @retval E_ROFS read-only file system
/** Move a file to a new destination or rename it, taking old file's identity (if exists).
Moves or renames a file, replacing an existing file if exist. If the old file existed, moved file's metadata, e.g. creation time (on FSes which keep files' creation time) or ACLs, are set to old one's (to keep the old file's identity) - currently this is only implemented fully on Windows; on other platforms, this is mostly equivalent to move().
@param[in] ustrSourceFileURL Full qualified URL of the source file.
@param[in] ustrDestFileURL Full qualified URL of the destination file.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_PERM operation not permitted @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file @retval E_ROFS read-only file system @retval E_BUSY device or resource busy
@param[in] ustrFileURL Full qualified URL of the file to remove.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_PERM operation not permitted @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file or directory @retval E_ISDIR is a directory @retval E_ROFS read-only file system @retval E_FAULT bad address @retval E_LOOP too many symbolic links encountered @retval E_IO on I/O errors @retval E_BUSY device or resource busy @retval E_INTR function call was interrupted @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed @retval E_TXTBSY text file busy
@return true if object is valid directory item else false.
*/
bool is()
{ return _pData != NULL;
}
/** Retrieve a single directory item.
Retrieves a single directory item. The returned handle has an initial refcount of 1. Due to performance issues it is not recommended to use this function while enumerating the contents of a directory. In this case use osl_getNextDirectoryItem() instead.
@param[in] ustrFileURL An absolute file URL.
@param[out] rItem On success it receives a handle which can be used for subsequent calls to osl_getFileStatus(). The handle has to be released by a call to osl_releaseDirectoryItem().
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_MFILE too many open files used by the process @retval E_NFILE too many open files in the system @retval E_NOENT no such file or directory @retval E_LOOP too many symbolic links encountered @retval E_NAMETOOLONG the file name is too long @retval E_NOTDIR a component of the path prefix of path is not a directory @retval E_IO on I/O errors @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed @retval E_FAULT bad address @retval E_INTR the function call was interrupted
/** Retrieve information about a single file or directory.
@param[in,out] rStatus Reference to a class which receives the information of the file or directory represented by this directory item.
@retval E_None on success @retval E_NOMEM not enough memory for allocating structures @retval E_INVAL the format of the parameters was not valid @retval E_LOOP too many symbolic links encountered @retval E_ACCES permission denied @retval E_NOENT no such file or directory @retval E_NAMETOOLONG file name too long @retval E_BADF invalid oslDirectoryItem parameter @retval E_FAULT bad address @retval E_OVERFLOW value too large for defined data type @retval E_INTR function call was interrupted @retval E_NOLINK link has been severed @retval E_MULTIHOP components of path require hopping to multiple remote machines and the file system does not allow it @retval E_MFILE too many open files used by the process @retval E_NFILE too many open files in the system @retval E_NOSPC no space left on device @retval E_NXIO no such device or address @retval E_IO on I/O errors @retval E_NOSYS function not implemented
/** Base class for observers of directory creation notifications.
Clients which uses the method createDirectoryPath of the class Directory may want to be informed about the directories that have been created. This may be accomplished by deriving from this base class and overwriting the virtual function DirectoryCreated.
@see Directory::createPath
*/ class DirectoryCreationObserver
{ public: virtual ~DirectoryCreationObserver() {}
/** This method will be called when a new directory has been created and needs to be overwritten by derived classes. You must not delete the directory that was just created otherwise you will run into an endless loop.
@param aDirectoryUrl [in]The absolute file URL of the directory that was just created by ::osl::Directory::createPath.
*/ virtualvoid DirectoryCreated(const rtl::OUString& aDirectoryUrl) = 0;
};
// This just an internal helper function for // private use. extern"C"inlinevoid SAL_CALL onDirectoryCreated(void* pData, rtl_uString* aDirectoryUrl)
{ static_cast<DirectoryCreationObserver*>(pData)->DirectoryCreated(aDirectoryUrl);
}
/** The directory class object provides an enumeration of DirectoryItems.
@see DirectoryItem @see File
*/
class Directory: public FileBase
{
oslDirectory _pData;
::rtl::OUString _aPath;
/** Open a directory for enumerating its contents.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOENT the specified path doesn't exist @retval E_NOTDIR the specified path is not a directory @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_MFILE too many open files used by the process @retval E_NFILE too many open files in the system @retval E_NAMETOOLONG File name too long @retval E_LOOP Too many symbolic links encountered
Query if directory is open and so item enumeration is valid.
@retval true if the directory is open else false.
@see open() @see close()
*/
bool isOpen() { return _pData != NULL; }
/** Close a directory.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_BADF invalid oslDirectory parameter @retval E_INTR the function call was interrupted
/** Resets the directory item enumeration to the beginning.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOENT the specified path doesn't exist @retval E_NOTDIR the specified path is not a directory @retval E_NOMEM not enough memory for allocating structures @retval E_ACCES permission denied @retval E_MFILE too many open files used by the process @retval E_NFILE too many open files in the system @retval E_NAMETOOLONG File name too long @retval E_LOOP Too many symbolic links encountered
@see open()
*/
RC reset()
{
close(); return open();
}
/** Retrieve the next item of a previously opened directory.
Retrieves the next item of a previously opened directory.
@param[out] rItem On success a valid DirectoryItem.
@param[in] nHint 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.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_NOENT no more entries in this directory @retval E_BADF invalid oslDirectory parameter @retval E_OVERFLOW the value too large for defined data type
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.
@param[in] ustrDirectoryURL Full qualified URL of the volume
@param[out] rInfo On success it receives information about the volume.
@retval E_None on success @retval E_NOMEM not enough memory for allocating structures @retval E_INVAL the format of the parameters was not valid @retval E_NOTDIR not a directory @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file or directory @retval E_ACCES permission denied @retval E_LOOP too many symbolic links encountered @retval E_FAULT Bad address @retval E_IO on I/O errors @retval E_NOSYS function not implemented @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed @retval E_INTR function call was interrupted
@param[in] ustrDirectoryURL Full qualified URL of the directory to create.
@param[in] flags Optional flags, see osl_createDirectoryWithFlags for details. This defaulted parameter is new since LibreOffice 4.3.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_EXIST file exists @retval E_ACCES permission denied @retval E_NAMETOOLONG file name too long @retval E_NOENT no such file or directory @retval E_NOTDIR not a directory @retval E_ROFS read-only file system @retval E_NOSPC no space left on device @retval E_DQUOT quota exceeded @retval E_LOOP too many symbolic links encountered @retval E_FAULT bad address @retval E_IO on I/O errors @retval E_MLINK too many links @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed
@param[in] ustrDirectoryURL Full qualified URL of the directory.
@retval E_None on success @retval E_INVAL the format of the parameters was not valid @retval E_NOMEM not enough memory for allocating structures @retval E_PERM operation not permitted @retval E_ACCES permission denied @retval E_NOENT no such file or directory @retval E_NOTDIR not a directory @retval E_NOTEMPTY directory not empty @retval E_FAULT bad address @retval E_NAMETOOLONG file name too long @retval E_BUSY device or resource busy @retval E_ROFS read-only file system @retval E_LOOP too many symbolic links encountered @retval E_EXIST file exists @retval E_IO on I/O errors @retval E_MULTIHOP multihop attempted @retval E_NOLINK link has been severed
The osl_createDirectoryPath function creates a specified directory path. All nonexisting sub directories will be created.
@attention You cannot rely on getting the error code E_EXIST for existing directories. Programming against this error code is in general a strong indication of a wrong usage of osl_createDirectoryPath.
@param aDirectoryUrl [in] The absolute file URL of the directory path to create. A relative file URL will not be accepted.
@param aDirectoryCreationObserver [in] Pointer to an instance of type DirectoryCreationObserver that will be informed about the creation of a directory. The value of this parameter may be NULL, in this case notifications will not be sent.
@retval E_None On success @retval E_INVAL The format of the parameters was not valid @retval E_ACCES Permission denied @retval E_EXIST The final node of the specified directory path already exist @retval E_NAMETOOLONG The name of the specified directory path exceeds the maximum allowed length @retval E_NOTDIR A component of the specified directory path already exist as file in any part of the directory path @retval E_ROFS Read-only file system @retval E_NOSPC No space left on device @retval E_DQUOT Quota exceeded @retval E_FAULT Bad address @retval E_IO I/O error @retval E_LOOP Too many symbolic links encountered @retval E_NOLINK Link has been severed @retval E_invalidError An unknown error occurred
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.