1*9eab2a37SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9eab2a37SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9eab2a37SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9eab2a37SAndrew Rist * distributed with this work for additional information 6*9eab2a37SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9eab2a37SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9eab2a37SAndrew Rist * "License"); you may not use this file except in compliance 9*9eab2a37SAndrew Rist * with the License. You may obtain a copy of the License at 10*9eab2a37SAndrew Rist * 11*9eab2a37SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9eab2a37SAndrew Rist * 13*9eab2a37SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9eab2a37SAndrew Rist * software distributed under the License is distributed on an 15*9eab2a37SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9eab2a37SAndrew Rist * KIND, either express or implied. See the License for the 17*9eab2a37SAndrew Rist * specific language governing permissions and limitations 18*9eab2a37SAndrew Rist * under the License. 19*9eab2a37SAndrew Rist * 20*9eab2a37SAndrew Rist *************************************************************/ 21*9eab2a37SAndrew Rist 22*9eab2a37SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir /** @HTML */ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef _OSL_FILE_H_ 27cdf0e10cSrcweir #define _OSL_FILE_H_ 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <osl/time.h> 30cdf0e10cSrcweir # include <rtl/ustring.h> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #ifdef __cplusplus 33cdf0e10cSrcweir extern "C" { 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir 36cdf0e10cSrcweir /** @file 37cdf0e10cSrcweir 38cdf0e10cSrcweir Main goals and usage hints 39cdf0e10cSrcweir 40cdf0e10cSrcweir The main intentention of this interface is to provide an universal portable and 41cdf0e10cSrcweir high performance access to file system issues on any operating system.<p> 42cdf0e10cSrcweir 43cdf0e10cSrcweir There are a few main goals:<p> 44cdf0e10cSrcweir 45cdf0e10cSrcweir 1.The path specifications always has to be absolut. Any usage of relative path 46cdf0e10cSrcweir specifications is forbidden. Exceptions are <code>osl_getSystemPathFromFileURL</code>, 47cdf0e10cSrcweir <code>osl_getFileURLFromSystemPath</code> and <code>osl_getAbsoluteFileURL</code>. Most operating systems 48cdf0e10cSrcweir provide a "Current Directory" per process. This is the reason why relative path 49cdf0e10cSrcweir specifications can cause problems in multithreading environments.<p> 50cdf0e10cSrcweir 51cdf0e10cSrcweir 2.Proprietary notations of file paths are not supported. Every path notation 52cdf0e10cSrcweir must the file URL specification. File URLs must be encoded in UTF8 and 53cdf0e10cSrcweir after that escaped. Although the URL parameter is a unicode string, the must 54cdf0e10cSrcweir contain only ASCII characters<p> 55cdf0e10cSrcweir 56cdf0e10cSrcweir 3.The caller cannot get any information whether a file system is case sensitive, 57cdf0e10cSrcweir case preserving or not. The operating system implementation itself should 58cdf0e10cSrcweir determine if it can map case-insensitive paths. The case correct notation of 59cdf0e10cSrcweir a filename or file path is part of the "File Info". This case correct name 60cdf0e10cSrcweir can be used as a unique key if neccessary.<p> 61cdf0e10cSrcweir 62cdf0e10cSrcweir 4. Obtaining information about files or volumes is controlled by a 63cdf0e10cSrcweir bitmask which specifies which fields are of interest. Due to performance 64cdf0e10cSrcweir issues it is not recommended to obtain information which is not needed. 65cdf0e10cSrcweir But if the operating system provides more information anyway the 66cdf0e10cSrcweir implementation can set more fields on output as were requested. It is in the 67cdf0e10cSrcweir responsibility of the caller to decide if he uses this additional information 68cdf0e10cSrcweir or not. But he should do so to prevent further unnecessary calls if the information 69cdf0e10cSrcweir is already there.<br> 70cdf0e10cSrcweir 71cdf0e10cSrcweir The input bitmask supports a flag <code>osl_FileStatus_Mask_Validate</code> which 72cdf0e10cSrcweir can be used to force retrieving uncached validated information. Setting this flag 73cdf0e10cSrcweir when calling <code>osl_getFileStatus</code> in combination with no other flag is 74cdf0e10cSrcweir a synonym for a "FileExists". This should only be done when processing a single file 75cdf0e10cSrcweir (f.e. before opening) and NEVER during enumeration of directory contents on any step 76cdf0e10cSrcweir of information processing. This would change the runtime behaviour from O(n) to 77cdf0e10cSrcweir O(n*n/2) on nearly every file system.<br> 78cdf0e10cSrcweir On Windows NT reading the contents of an directory with 7000 entries and 79cdf0e10cSrcweir getting full information about every file only takes 0.6 seconds. Specifying the 80cdf0e10cSrcweir flag <code>osl_FileStatus_Mask_Validate</code> for each entry will increase the 81cdf0e10cSrcweir time to 180 seconds (!!!). 82cdf0e10cSrcweir 83cdf0e10cSrcweir */ 84cdf0e10cSrcweir 85cdf0e10cSrcweir 86cdf0e10cSrcweir 87cdf0e10cSrcweir /* Error codes according to errno */ 88cdf0e10cSrcweir 89cdf0e10cSrcweir typedef enum { 90cdf0e10cSrcweir osl_File_E_None, 91cdf0e10cSrcweir osl_File_E_PERM, 92cdf0e10cSrcweir osl_File_E_NOENT, 93cdf0e10cSrcweir osl_File_E_SRCH, 94cdf0e10cSrcweir osl_File_E_INTR, 95cdf0e10cSrcweir osl_File_E_IO, 96cdf0e10cSrcweir osl_File_E_NXIO, 97cdf0e10cSrcweir osl_File_E_2BIG, 98cdf0e10cSrcweir osl_File_E_NOEXEC, 99cdf0e10cSrcweir osl_File_E_BADF, 100cdf0e10cSrcweir osl_File_E_CHILD, 101cdf0e10cSrcweir osl_File_E_AGAIN, 102cdf0e10cSrcweir osl_File_E_NOMEM, 103cdf0e10cSrcweir osl_File_E_ACCES, 104cdf0e10cSrcweir osl_File_E_FAULT, 105cdf0e10cSrcweir osl_File_E_BUSY, 106cdf0e10cSrcweir osl_File_E_EXIST, 107cdf0e10cSrcweir osl_File_E_XDEV, 108cdf0e10cSrcweir osl_File_E_NODEV, 109cdf0e10cSrcweir osl_File_E_NOTDIR, 110cdf0e10cSrcweir osl_File_E_ISDIR, 111cdf0e10cSrcweir osl_File_E_INVAL, 112cdf0e10cSrcweir osl_File_E_NFILE, 113cdf0e10cSrcweir osl_File_E_MFILE, 114cdf0e10cSrcweir osl_File_E_NOTTY, 115cdf0e10cSrcweir osl_File_E_FBIG, 116cdf0e10cSrcweir osl_File_E_NOSPC, 117cdf0e10cSrcweir osl_File_E_SPIPE, 118cdf0e10cSrcweir osl_File_E_ROFS, 119cdf0e10cSrcweir osl_File_E_MLINK, 120cdf0e10cSrcweir osl_File_E_PIPE, 121cdf0e10cSrcweir osl_File_E_DOM, 122cdf0e10cSrcweir osl_File_E_RANGE, 123cdf0e10cSrcweir osl_File_E_DEADLK, 124cdf0e10cSrcweir osl_File_E_NAMETOOLONG, 125cdf0e10cSrcweir osl_File_E_NOLCK, 126cdf0e10cSrcweir osl_File_E_NOSYS, 127cdf0e10cSrcweir osl_File_E_NOTEMPTY, 128cdf0e10cSrcweir osl_File_E_LOOP, 129cdf0e10cSrcweir osl_File_E_ILSEQ, 130cdf0e10cSrcweir osl_File_E_NOLINK, 131cdf0e10cSrcweir osl_File_E_MULTIHOP, 132cdf0e10cSrcweir osl_File_E_USERS, 133cdf0e10cSrcweir osl_File_E_OVERFLOW, 134cdf0e10cSrcweir osl_File_E_NOTREADY, 135cdf0e10cSrcweir osl_File_E_invalidError, /* unmapped error: always last entry in enum! */ 136cdf0e10cSrcweir osl_File_E_TIMEDOUT, 137cdf0e10cSrcweir osl_File_E_NETWORK, 138cdf0e10cSrcweir osl_File_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM 139cdf0e10cSrcweir } oslFileError; 140cdf0e10cSrcweir 141cdf0e10cSrcweir typedef void *oslDirectory; 142cdf0e10cSrcweir typedef void *oslDirectoryItem; 143cdf0e10cSrcweir 144cdf0e10cSrcweir 145cdf0e10cSrcweir /** Open a directory for enumerating its contents. 146cdf0e10cSrcweir 147cdf0e10cSrcweir @param pustrDirectoryURL [in] 148cdf0e10cSrcweir The full qualified URL of the directory. 149cdf0e10cSrcweir 150cdf0e10cSrcweir @param pDirectory [out] 151cdf0e10cSrcweir On success it receives a handle used for subsequent calls by osl_getNextDirectoryItem(). 152cdf0e10cSrcweir The handle has to be released by a call to osl_closeDirectory(). 153cdf0e10cSrcweir 154cdf0e10cSrcweir @return 155cdf0e10cSrcweir osl_File_E_None on success<br> 156cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 157cdf0e10cSrcweir osl_File_E_NOENT the specified path doesn't exist<br> 158cdf0e10cSrcweir osl_File_E_NOTDIR the specified path is not an directory <br> 159cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 160cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 161cdf0e10cSrcweir osl_File_E_MFILE too many open files used by the process<br> 162cdf0e10cSrcweir osl_File_E_NFILE too many open files in the system<br> 163cdf0e10cSrcweir osl_File_E_NAMETOOLONG File name too long<br> 164cdf0e10cSrcweir osl_File_E_LOOP Too many symbolic links encountered<p> 165cdf0e10cSrcweir 166cdf0e10cSrcweir @see osl_getNextDirectoryItem() 167cdf0e10cSrcweir @see osl_closeDirectory() 168cdf0e10cSrcweir */ 169cdf0e10cSrcweir 170cdf0e10cSrcweir oslFileError SAL_CALL osl_openDirectory( rtl_uString *pustrDirectoryURL, oslDirectory *pDirectory); 171cdf0e10cSrcweir 172cdf0e10cSrcweir 173cdf0e10cSrcweir /** Retrieve the next item of a previously opened directory. 174cdf0e10cSrcweir 175cdf0e10cSrcweir Retrieves the next item of a previously opened directory. 176cdf0e10cSrcweir All handles have an initial refcount of 1. 177cdf0e10cSrcweir 178cdf0e10cSrcweir @param Directory [in] 179cdf0e10cSrcweir A directory handle received from a previous call to osl_openDirectory(). 180cdf0e10cSrcweir 181cdf0e10cSrcweir @param pItem [out] 182cdf0e10cSrcweir On success it receives a handle that can be used for subsequent calls to osl_getFileStatus(). 183cdf0e10cSrcweir The handle has to be released by a call to osl_releaseDirectoryItem(). 184cdf0e10cSrcweir 185cdf0e10cSrcweir @param uHint [in] 186cdf0e10cSrcweir With this parameter the caller can tell the implementation that (s)he 187cdf0e10cSrcweir is going to call this function uHint times afterwards. This enables the implementation to 188cdf0e10cSrcweir get the information for more than one file and cache it until the next calls. 189cdf0e10cSrcweir 190cdf0e10cSrcweir @return 191cdf0e10cSrcweir osl_File_E_None on success<br> 192cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 193cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 194cdf0e10cSrcweir osl_File_E_NOENT no more entries in this directory<br> 195cdf0e10cSrcweir osl_File_E_BADF invalid oslDirectory parameter<br> 196cdf0e10cSrcweir osl_File_E_OVERFLOW the value too large for defined data type 197cdf0e10cSrcweir 198cdf0e10cSrcweir @see osl_releaseDirectoryItem() 199cdf0e10cSrcweir @see osl_acquireDirectoryItem() 200cdf0e10cSrcweir @see osl_getDirectoryItem() 201cdf0e10cSrcweir @see osl_getFileStatus() 202cdf0e10cSrcweir */ 203cdf0e10cSrcweir 204cdf0e10cSrcweir oslFileError SAL_CALL osl_getNextDirectoryItem( 205cdf0e10cSrcweir oslDirectory Directory, 206cdf0e10cSrcweir oslDirectoryItem *pItem, 207cdf0e10cSrcweir sal_uInt32 uHint 208cdf0e10cSrcweir ); 209cdf0e10cSrcweir 210cdf0e10cSrcweir 211cdf0e10cSrcweir /** Release a directory handle. 212cdf0e10cSrcweir 213cdf0e10cSrcweir @param Directory [in] 214cdf0e10cSrcweir A handle received by a call to osl_openDirectory(). 215cdf0e10cSrcweir 216cdf0e10cSrcweir @return 217cdf0e10cSrcweir osl_File_E_None on success<br> 218cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 219cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures<br> 220cdf0e10cSrcweir osl_File_E_BADF invalid oslDirectory parameter<br> 221cdf0e10cSrcweir osl_File_E_INTR the function call was interrupted<p> 222cdf0e10cSrcweir 223cdf0e10cSrcweir @see osl_openDirectory() 224cdf0e10cSrcweir */ 225cdf0e10cSrcweir 226cdf0e10cSrcweir oslFileError SAL_CALL osl_closeDirectory(oslDirectory Directory); 227cdf0e10cSrcweir 228cdf0e10cSrcweir 229cdf0e10cSrcweir /** Retrieve a single directory item. 230cdf0e10cSrcweir 231cdf0e10cSrcweir Retrieves a single directory item. The returned handle has an initial refcount of 1. 232cdf0e10cSrcweir Due to performance issues it is not recommended to use this function while 233cdf0e10cSrcweir enumerating the contents of a directory. In this case use osl_getNextDirectoryItem() instead. 234cdf0e10cSrcweir 235cdf0e10cSrcweir @param pustrFileURL [in] 236cdf0e10cSrcweir An absolute file URL. 237cdf0e10cSrcweir 238cdf0e10cSrcweir @param pItem [out] 239cdf0e10cSrcweir On success it receives a handle which can be used for subsequent calls to osl_getFileStatus(). 240cdf0e10cSrcweir The handle has to be released by a call to osl_releaseDirectoryItem(). 241cdf0e10cSrcweir 242cdf0e10cSrcweir @return 243cdf0e10cSrcweir osl_File_E_None on success<br> 244cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 245cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 246cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 247cdf0e10cSrcweir osl_File_E_MFILE too many open files used by the process<br> 248cdf0e10cSrcweir osl_File_E_NFILE too many open files in the system<br> 249cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 250cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 251cdf0e10cSrcweir osl_File_E_NAMETOOLONG the file name is too long<br> 252cdf0e10cSrcweir osl_File_E_NOTDIR a component of the path prefix of path is not a directory<br> 253cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 254cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 255cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 256cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 257cdf0e10cSrcweir osl_File_E_INTR the function call was interrupted<p> 258cdf0e10cSrcweir 259cdf0e10cSrcweir @see osl_releaseDirectoryItem() 260cdf0e10cSrcweir @see osl_acquireDirectoryItem() 261cdf0e10cSrcweir @see osl_getFileStatus() 262cdf0e10cSrcweir @see osl_getNextDirectoryItem() 263cdf0e10cSrcweir */ 264cdf0e10cSrcweir 265cdf0e10cSrcweir oslFileError SAL_CALL osl_getDirectoryItem( 266cdf0e10cSrcweir rtl_uString *pustrFileURL, 267cdf0e10cSrcweir oslDirectoryItem *pItem 268cdf0e10cSrcweir ); 269cdf0e10cSrcweir 270cdf0e10cSrcweir 271cdf0e10cSrcweir /** Increase the refcount of a directory item handle. 272cdf0e10cSrcweir 273cdf0e10cSrcweir The caller responsible for releasing the directory item handle using osl_releaseDirectoryItem(). 274cdf0e10cSrcweir 275cdf0e10cSrcweir @param Item [in] 276cdf0e10cSrcweir A handle received by a call to osl_getDirectoryItem() or osl_getNextDirectoryItem(). 277cdf0e10cSrcweir 278cdf0e10cSrcweir @return 279cdf0e10cSrcweir osl_File_E_None on success<br> 280cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures<br> 281cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 282cdf0e10cSrcweir 283cdf0e10cSrcweir @see osl_getDirectoryItem() 284cdf0e10cSrcweir @see osl_getNextDirectoryItem() 285cdf0e10cSrcweir @see osl_releaseDirectoryItem() 286cdf0e10cSrcweir */ 287cdf0e10cSrcweir 288cdf0e10cSrcweir oslFileError SAL_CALL osl_acquireDirectoryItem( oslDirectoryItem Item ); 289cdf0e10cSrcweir 290cdf0e10cSrcweir 291cdf0e10cSrcweir /** Decrease the refcount of a directory item handle. 292cdf0e10cSrcweir 293cdf0e10cSrcweir Decreases the refcount of a directory item handle. 294cdf0e10cSrcweir If the refcount reaches 0 the data associated with 295cdf0e10cSrcweir this directory item handle will be released. 296cdf0e10cSrcweir 297cdf0e10cSrcweir @param Item [in] 298cdf0e10cSrcweir A handle received by a call to osl_getDirectoryItem() or osl_getNextDirectoryItem(). 299cdf0e10cSrcweir 300cdf0e10cSrcweir @return 301cdf0e10cSrcweir osl_File_E_None on success<br> 302cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures<br> 303cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 304cdf0e10cSrcweir 305cdf0e10cSrcweir @see osl_getDirectoryItem() 306cdf0e10cSrcweir @see osl_getNextDirectoryItem() 307cdf0e10cSrcweir @see osl_acquireDirectoryItem() 308cdf0e10cSrcweir */ 309cdf0e10cSrcweir 310cdf0e10cSrcweir oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item ); 311cdf0e10cSrcweir 312cdf0e10cSrcweir /* File types */ 313cdf0e10cSrcweir 314cdf0e10cSrcweir typedef enum { 315cdf0e10cSrcweir osl_File_Type_Directory, 316cdf0e10cSrcweir osl_File_Type_Volume, 317cdf0e10cSrcweir osl_File_Type_Regular, 318cdf0e10cSrcweir osl_File_Type_Fifo, 319cdf0e10cSrcweir osl_File_Type_Socket, 320cdf0e10cSrcweir osl_File_Type_Link, 321cdf0e10cSrcweir osl_File_Type_Special, 322cdf0e10cSrcweir osl_File_Type_Unknown 323cdf0e10cSrcweir } oslFileType; 324cdf0e10cSrcweir 325cdf0e10cSrcweir /* File attributes */ 326cdf0e10cSrcweir #define osl_File_Attribute_ReadOnly 0x00000001 327cdf0e10cSrcweir #define osl_File_Attribute_Hidden 0x00000002 328cdf0e10cSrcweir #define osl_File_Attribute_Executable 0x00000010 329cdf0e10cSrcweir #define osl_File_Attribute_GrpWrite 0x00000020 330cdf0e10cSrcweir #define osl_File_Attribute_GrpRead 0x00000040 331cdf0e10cSrcweir #define osl_File_Attribute_GrpExe 0x00000080 332cdf0e10cSrcweir #define osl_File_Attribute_OwnWrite 0x00000100 333cdf0e10cSrcweir #define osl_File_Attribute_OwnRead 0x00000200 334cdf0e10cSrcweir #define osl_File_Attribute_OwnExe 0x00000400 335cdf0e10cSrcweir #define osl_File_Attribute_OthWrite 0x00000800 336cdf0e10cSrcweir #define osl_File_Attribute_OthRead 0x00001000 337cdf0e10cSrcweir #define osl_File_Attribute_OthExe 0x00002000 338cdf0e10cSrcweir 339cdf0e10cSrcweir /* Flags specifying which fields to retreive by osl_getFileStatus */ 340cdf0e10cSrcweir 341cdf0e10cSrcweir #define osl_FileStatus_Mask_Type 0x00000001 342cdf0e10cSrcweir #define osl_FileStatus_Mask_Attributes 0x00000002 343cdf0e10cSrcweir #define osl_FileStatus_Mask_CreationTime 0x00000010 344cdf0e10cSrcweir #define osl_FileStatus_Mask_AccessTime 0x00000020 345cdf0e10cSrcweir #define osl_FileStatus_Mask_ModifyTime 0x00000040 346cdf0e10cSrcweir #define osl_FileStatus_Mask_FileSize 0x00000080 347cdf0e10cSrcweir #define osl_FileStatus_Mask_FileName 0x00000100 348cdf0e10cSrcweir #define osl_FileStatus_Mask_FileURL 0x00000200 349cdf0e10cSrcweir #define osl_FileStatus_Mask_LinkTargetURL 0x00000400 350cdf0e10cSrcweir #define osl_FileStatus_Mask_All 0x7FFFFFFF 351cdf0e10cSrcweir #define osl_FileStatus_Mask_Validate 0x80000000 352cdf0e10cSrcweir 353cdf0e10cSrcweir 354cdf0e10cSrcweir typedef 355cdf0e10cSrcweir 356cdf0e10cSrcweir /** Structure containing information about files and directories 357cdf0e10cSrcweir 358cdf0e10cSrcweir @see osl_getFileStatus() 359cdf0e10cSrcweir @see oslFileType 360cdf0e10cSrcweir */ 361cdf0e10cSrcweir 362cdf0e10cSrcweir struct _oslFileStatus { 363cdf0e10cSrcweir /** Must be initialized with the size in bytes of the structure before passing it to any function */ 364cdf0e10cSrcweir sal_uInt32 uStructSize; 365cdf0e10cSrcweir /** Determines which members of the structure contain valid data */ 366cdf0e10cSrcweir sal_uInt32 uValidFields; 367cdf0e10cSrcweir /** The type of the file (file, directory, volume). */ 368cdf0e10cSrcweir oslFileType eType; 369cdf0e10cSrcweir /** File attributes */ 370cdf0e10cSrcweir sal_uInt64 uAttributes; 371cdf0e10cSrcweir /** First creation time in nanoseconds since 1/1/1970. Can be the last modify time depending on 372cdf0e10cSrcweir platform or file system. */ 373cdf0e10cSrcweir TimeValue aCreationTime; 374cdf0e10cSrcweir /** Last access time in nanoseconds since 1/1/1970. Can be the last modify time depending on 375cdf0e10cSrcweir platform or file system. */ 376cdf0e10cSrcweir TimeValue aAccessTime; 377cdf0e10cSrcweir /** Last modify time in nanoseconds since 1/1/1970. */ 378cdf0e10cSrcweir TimeValue aModifyTime; 379cdf0e10cSrcweir /** Size in bytes of the file. Zero for directories and volumes. */ 380cdf0e10cSrcweir sal_uInt64 uFileSize; 381cdf0e10cSrcweir /** Case correct name of the file. Should be set to zero before calling <code>osl_getFileStatus</code> 382cdf0e10cSrcweir and released after usage. */ 383cdf0e10cSrcweir rtl_uString *ustrFileName; 384cdf0e10cSrcweir /** Full URL of the file. Should be set to zero before calling <code>osl_getFileStatus</code> 385cdf0e10cSrcweir and released after usage. */ 386cdf0e10cSrcweir rtl_uString *ustrFileURL; 387cdf0e10cSrcweir /** Full URL of the target file if the file itself is a link. 388cdf0e10cSrcweir Should be set to zero before calling <code>osl_getFileStatus</code> 389cdf0e10cSrcweir and released after usage. */ 390cdf0e10cSrcweir rtl_uString *ustrLinkTargetURL; 391cdf0e10cSrcweir } oslFileStatus; 392cdf0e10cSrcweir 393cdf0e10cSrcweir 394cdf0e10cSrcweir /** Retrieve information about a single file or directory. 395cdf0e10cSrcweir 396cdf0e10cSrcweir @param Item [in] 397cdf0e10cSrcweir A handle received by a previous call to osl_getDirectoryItem() or osl_getNextDirectoryItem(). 398cdf0e10cSrcweir 399cdf0e10cSrcweir @param pStatus [in|out] 400cdf0e10cSrcweir Points to a structure which receives the information of the file or directory 401cdf0e10cSrcweir represented by the handle Item. The member uStructSize has to be initialized to 402cdf0e10cSrcweir sizeof(oslFileStatus) before calling this function. 403cdf0e10cSrcweir 404cdf0e10cSrcweir @param uFieldMask [in] 405cdf0e10cSrcweir Specifies which fields of the structure pointed to by pStatus are of interest to the caller. 406cdf0e10cSrcweir 407cdf0e10cSrcweir @return 408cdf0e10cSrcweir osl_File_E_None on success<br> 409cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 410cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 411cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 412cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 413cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 414cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 415cdf0e10cSrcweir osl_File_E_BADF invalid oslDirectoryItem parameter<br> 416cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 417cdf0e10cSrcweir osl_File_E_OVERFLOW value too large for defined data type<br> 418cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 419cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 420cdf0e10cSrcweir osl_File_E_MULTIHOP components of path require hopping to multiple remote machines and the file system does not allow it<br> 421cdf0e10cSrcweir osl_File_E_MFILE too many open files used by the process<br> 422cdf0e10cSrcweir osl_File_E_NFILE too many open files in the system<br> 423cdf0e10cSrcweir osl_File_E_NOSPC no space left on device<br> 424cdf0e10cSrcweir osl_File_E_NXIO no such device or address<br> 425cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 426cdf0e10cSrcweir osl_File_E_NOSYS function not implemented<p> 427cdf0e10cSrcweir 428cdf0e10cSrcweir @see osl_getDirectoryItem() 429cdf0e10cSrcweir @see osl_getNextDirectoryItem() 430cdf0e10cSrcweir @see oslFileStatus 431cdf0e10cSrcweir */ 432cdf0e10cSrcweir 433cdf0e10cSrcweir oslFileError SAL_CALL osl_getFileStatus( oslDirectoryItem Item, oslFileStatus *pStatus, sal_uInt32 uFieldMask ); 434cdf0e10cSrcweir 435cdf0e10cSrcweir 436cdf0e10cSrcweir typedef void *oslVolumeDeviceHandle; 437cdf0e10cSrcweir 438cdf0e10cSrcweir 439cdf0e10cSrcweir /** Unmount a volume device. 440cdf0e10cSrcweir 441cdf0e10cSrcweir Unmount the volume specified by the given oslVolumeDeviceHandle. 442cdf0e10cSrcweir 443cdf0e10cSrcweir @param Handle [in] 444cdf0e10cSrcweir An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). 445cdf0e10cSrcweir 446cdf0e10cSrcweir @return 447cdf0e10cSrcweir osl_File_E_None on success<br> 448cdf0e10cSrcweir 449cdf0e10cSrcweir @todo 450cdf0e10cSrcweir specify all error codes that may be returned 451cdf0e10cSrcweir 452cdf0e10cSrcweir @see osl_getVolumeInformation() 453cdf0e10cSrcweir */ 454cdf0e10cSrcweir 455cdf0e10cSrcweir oslFileError SAL_CALL osl_unmountVolumeDevice( oslVolumeDeviceHandle Handle ); 456cdf0e10cSrcweir 457cdf0e10cSrcweir 458cdf0e10cSrcweir /** Automount a volume device. 459cdf0e10cSrcweir 460cdf0e10cSrcweir Automount the volume device specified by the given oslVolumeDeviceHandle. 461cdf0e10cSrcweir 462cdf0e10cSrcweir @param Handle [in] 463cdf0e10cSrcweir An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). 464cdf0e10cSrcweir 465cdf0e10cSrcweir @return 466cdf0e10cSrcweir osl_File_E_None on success<br> 467cdf0e10cSrcweir 468cdf0e10cSrcweir @todo 469cdf0e10cSrcweir specify all error codes that may be returned 470cdf0e10cSrcweir 471cdf0e10cSrcweir @see osl_getVolumeInformation() 472cdf0e10cSrcweir */ 473cdf0e10cSrcweir 474cdf0e10cSrcweir oslFileError SAL_CALL osl_automountVolumeDevice( oslVolumeDeviceHandle Handle ); 475cdf0e10cSrcweir 476cdf0e10cSrcweir 477cdf0e10cSrcweir /** Release a volume device handle. 478cdf0e10cSrcweir 479cdf0e10cSrcweir Releases the given oslVolumeDeviceHandle which was acquired by a call to 480cdf0e10cSrcweir osl_getVolumeInformation() or osl_acquireVolumeDeviceHandle(). 481cdf0e10cSrcweir 482cdf0e10cSrcweir @param Handle [in] 483cdf0e10cSrcweir An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). 484cdf0e10cSrcweir 485cdf0e10cSrcweir @return 486cdf0e10cSrcweir osl_File_E_None on success<br> 487cdf0e10cSrcweir 488cdf0e10cSrcweir @todo 489cdf0e10cSrcweir specify all error codes that may be returned 490cdf0e10cSrcweir 491cdf0e10cSrcweir @see osl_acquireVolumeDeviceHandle() 492cdf0e10cSrcweir @see osl_getVolumeInformation() 493cdf0e10cSrcweir */ 494cdf0e10cSrcweir 495cdf0e10cSrcweir oslFileError SAL_CALL osl_releaseVolumeDeviceHandle( oslVolumeDeviceHandle Handle ); 496cdf0e10cSrcweir 497cdf0e10cSrcweir /** Acquire a volume device handle. 498cdf0e10cSrcweir 499cdf0e10cSrcweir Acquires the given oslVolumeDeviceHandle which was acquired by a call to 500cdf0e10cSrcweir osl_getVolumeInformation(). The caller is responsible for releasing the 501cdf0e10cSrcweir acquired handle by calling osl_releaseVolumeDeviceHandle(). 502cdf0e10cSrcweir 503cdf0e10cSrcweir @param Handle [in] 504cdf0e10cSrcweir An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). 505cdf0e10cSrcweir 506cdf0e10cSrcweir @return 507cdf0e10cSrcweir osl_File_E_None on success<br> 508cdf0e10cSrcweir 509cdf0e10cSrcweir @todo 510cdf0e10cSrcweir specify all error codes that may be returned 511cdf0e10cSrcweir 512cdf0e10cSrcweir @see osl_getVolumeInformation() 513cdf0e10cSrcweir */ 514cdf0e10cSrcweir 515cdf0e10cSrcweir oslFileError SAL_CALL osl_acquireVolumeDeviceHandle( oslVolumeDeviceHandle Handle ); 516cdf0e10cSrcweir 517cdf0e10cSrcweir 518cdf0e10cSrcweir /** Get the full qualified URL where a device is mounted to. 519cdf0e10cSrcweir 520cdf0e10cSrcweir @param Handle [in] 521cdf0e10cSrcweir An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation(). 522cdf0e10cSrcweir 523cdf0e10cSrcweir @param ppustrDirectoryURL [out] 524cdf0e10cSrcweir Receives the full qualified URL where the device is mounted to. 525cdf0e10cSrcweir 526cdf0e10cSrcweir @return 527cdf0e10cSrcweir osl_File_E_None on success<br> 528cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 529cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 530cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 531cdf0e10cSrcweir osl_File_E_NXIO no such device or address<br> 532cdf0e10cSrcweir osl_File_E_NODEV no such device<br> 533cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 534cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 535cdf0e10cSrcweir osl_FilE_E_INTR function call was interrupted<br> 536cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 537cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 538cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 539cdf0e10cSrcweir osl_File_E_EOVERFLOW value too large for defined data type<br> 540cdf0e10cSrcweir 541cdf0e10cSrcweir @see osl_getVolumeInformation() 542cdf0e10cSrcweir @see osl_automountVolumeDevice() 543cdf0e10cSrcweir @see osl_unmountVolumeDevice() 544cdf0e10cSrcweir */ 545cdf0e10cSrcweir 546cdf0e10cSrcweir oslFileError SAL_CALL osl_getVolumeDeviceMountPath( oslVolumeDeviceHandle Handle, rtl_uString **ppustrDirectoryURL); 547cdf0e10cSrcweir 548cdf0e10cSrcweir /* Volume attributes */ 549cdf0e10cSrcweir 550cdf0e10cSrcweir #define osl_Volume_Attribute_Removeable 0x00000001L 551cdf0e10cSrcweir #define osl_Volume_Attribute_Remote 0x00000002L 552cdf0e10cSrcweir #define osl_Volume_Attribute_CompactDisc 0x00000004L 553cdf0e10cSrcweir #define osl_Volume_Attribute_FixedDisk 0x00000008L 554cdf0e10cSrcweir #define osl_Volume_Attribute_RAMDisk 0x00000010L 555cdf0e10cSrcweir #define osl_Volume_Attribute_FloppyDisk 0x00000020L 556cdf0e10cSrcweir 557cdf0e10cSrcweir #define osl_Volume_Attribute_Case_Is_Preserved 0x00000040L 558cdf0e10cSrcweir #define osl_Volume_Attribute_Case_Sensitive 0x00000080L 559cdf0e10cSrcweir 560cdf0e10cSrcweir /* Flags specifying which fields to retreive by osl_getVolumeInfo */ 561cdf0e10cSrcweir 562cdf0e10cSrcweir #define osl_VolumeInfo_Mask_Attributes 0x00000001L 563cdf0e10cSrcweir #define osl_VolumeInfo_Mask_TotalSpace 0x00000002L 564cdf0e10cSrcweir #define osl_VolumeInfo_Mask_UsedSpace 0x00000004L 565cdf0e10cSrcweir #define osl_VolumeInfo_Mask_FreeSpace 0x00000008L 566cdf0e10cSrcweir #define osl_VolumeInfo_Mask_MaxNameLength 0x00000010L 567cdf0e10cSrcweir #define osl_VolumeInfo_Mask_MaxPathLength 0x00000020L 568cdf0e10cSrcweir #define osl_VolumeInfo_Mask_FileSystemName 0x00000040L 569cdf0e10cSrcweir #define osl_VolumeInfo_Mask_DeviceHandle 0x00000080L 570cdf0e10cSrcweir #define osl_VolumeInfo_Mask_FileSystemCaseHandling 0x00000100L 571cdf0e10cSrcweir 572cdf0e10cSrcweir typedef 573cdf0e10cSrcweir 574cdf0e10cSrcweir /** Structure containing information about volumes 575cdf0e10cSrcweir 576cdf0e10cSrcweir @see osl_getVolumeInformation() 577cdf0e10cSrcweir @see oslFileType 578cdf0e10cSrcweir */ 579cdf0e10cSrcweir 580cdf0e10cSrcweir struct _oslVolumeInfo { 581cdf0e10cSrcweir /** Must be initialized with the size in bytes of the structure before passing it to any function */ 582cdf0e10cSrcweir sal_uInt32 uStructSize; 583cdf0e10cSrcweir /** Determines which members of the structure contain valid data */ 584cdf0e10cSrcweir sal_uInt32 uValidFields; 585cdf0e10cSrcweir /** Attributes of the volume (remote and/or removable) */ 586cdf0e10cSrcweir sal_uInt32 uAttributes; 587cdf0e10cSrcweir /** Total availiable space on the volume for the current process/user */ 588cdf0e10cSrcweir sal_uInt64 uTotalSpace; 589cdf0e10cSrcweir /** Used space on the volume for the current process/user */ 590cdf0e10cSrcweir sal_uInt64 uUsedSpace; 591cdf0e10cSrcweir /** Free space on the volume for the current process/user */ 592cdf0e10cSrcweir sal_uInt64 uFreeSpace; 593cdf0e10cSrcweir /** Maximum length of file name of a single item */ 594cdf0e10cSrcweir sal_uInt32 uMaxNameLength; 595cdf0e10cSrcweir /** Maximum length of a full quallified path in system notation */ 596cdf0e10cSrcweir sal_uInt32 uMaxPathLength; 597cdf0e10cSrcweir /** Points to a string that receives the name of the file system type. String should be set to zero before calling <code>osl_getVolumeInformation</code> 598cdf0e10cSrcweir and released after usage. */ 599cdf0e10cSrcweir rtl_uString *ustrFileSystemName; 600cdf0e10cSrcweir /** Pointer to handle the receives underlying device. Handle should be set to zero before calling <code>osl_getVolumeInformation</code>*/ 601cdf0e10cSrcweir oslVolumeDeviceHandle *pDeviceHandle; 602cdf0e10cSrcweir } oslVolumeInfo; 603cdf0e10cSrcweir 604cdf0e10cSrcweir 605cdf0e10cSrcweir /** Retrieve information about a volume. 606cdf0e10cSrcweir 607cdf0e10cSrcweir Retrieves information about a volume. A volume can either be a mount point, a network 608cdf0e10cSrcweir resource or a drive depending on Operating System and File System. Before calling this 609cdf0e10cSrcweir function osl_getFileStatus() should be called to determine if the type is 610cdf0e10cSrcweir osl_file_Type_Volume. 611cdf0e10cSrcweir 612cdf0e10cSrcweir @param pustrDirectoryURL [in] 613cdf0e10cSrcweir Full qualified URL of the volume 614cdf0e10cSrcweir 615cdf0e10cSrcweir @param pInfo [out] 616cdf0e10cSrcweir On success it receives information about the volume. 617cdf0e10cSrcweir 618cdf0e10cSrcweir @param uFieldMask [in] 619cdf0e10cSrcweir Specifies which members of the structure should be filled 620cdf0e10cSrcweir 621cdf0e10cSrcweir @return 622cdf0e10cSrcweir osl_File_E_None on success<br> 623cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 624cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 625cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 626cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 627cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 628cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 629cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 630cdf0e10cSrcweir ols_File_E_FAULT Bad address<br> 631cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 632cdf0e10cSrcweir osl_File_E_NOSYS function not implemented<br> 633cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 634cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 635cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 636cdf0e10cSrcweir 637cdf0e10cSrcweir @see osl_getFileStatus() 638cdf0e10cSrcweir @see oslVolumeInfo 639cdf0e10cSrcweir */ 640cdf0e10cSrcweir 641cdf0e10cSrcweir oslFileError SAL_CALL osl_getVolumeInformation( 642cdf0e10cSrcweir rtl_uString *pustrDirectoryURL, 643cdf0e10cSrcweir oslVolumeInfo *pInfo, 644cdf0e10cSrcweir sal_uInt32 uFieldMask ); 645cdf0e10cSrcweir 646cdf0e10cSrcweir typedef void *oslFileHandle; 647cdf0e10cSrcweir 648cdf0e10cSrcweir /* Open flags */ 649cdf0e10cSrcweir 650cdf0e10cSrcweir #define osl_File_OpenFlag_Read 0x00000001L 651cdf0e10cSrcweir #define osl_File_OpenFlag_Write 0x00000002L 652cdf0e10cSrcweir #define osl_File_OpenFlag_Create 0x00000004L 653cdf0e10cSrcweir #define osl_File_OpenFlag_NoLock 0x00000008L 654cdf0e10cSrcweir 655cdf0e10cSrcweir /** Open a regular file. 656cdf0e10cSrcweir 657cdf0e10cSrcweir Open a file. Only regular files can be openend. 658cdf0e10cSrcweir 659cdf0e10cSrcweir @param pustrFileURL [in] 660cdf0e10cSrcweir The full qualified URL of the file to open. 661cdf0e10cSrcweir 662cdf0e10cSrcweir @param pHandle [out] 663cdf0e10cSrcweir On success it receives a handle to the open file. 664cdf0e10cSrcweir 665cdf0e10cSrcweir @param uFlags [in] 666cdf0e10cSrcweir Specifies the open mode. 667cdf0e10cSrcweir 668cdf0e10cSrcweir @return 669cdf0e10cSrcweir osl_File_E_None on success<br> 670cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 671cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 672cdf0e10cSrcweir osl_File_E_NAMETOOLONG pathname was too long<br> 673cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 674cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 675cdf0e10cSrcweir osl_File_E_AGAIN a write lock could not be established<br> 676cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 677cdf0e10cSrcweir osl_File_E_NXIO no such device or address<br> 678cdf0e10cSrcweir osl_File_E_NODEV no such device<br> 679cdf0e10cSrcweir osl_File_E_ROFS read-only file system<br> 680cdf0e10cSrcweir osl_File_E_TXTBSY text file busy<br> 681cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 682cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 683cdf0e10cSrcweir osl_File_E_NOSPC no space left on device<br> 684cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 685cdf0e10cSrcweir osl_File_E_MFILE too many open files used by the process<br> 686cdf0e10cSrcweir osl_File_E_NFILE too many open files in the system<br> 687cdf0e10cSrcweir osl_File_E_DQUOT quota exceeded<br> 688cdf0e10cSrcweir osl_File_E_EXIST file exists<br> 689cdf0e10cSrcweir osl_FilE_E_INTR function call was interrupted<br> 690cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 691cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 692cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 693cdf0e10cSrcweir osl_File_E_EOVERFLOW value too large for defined data type<br> 694cdf0e10cSrcweir 695cdf0e10cSrcweir @see osl_closeFile() 696cdf0e10cSrcweir @see osl_setFilePos() 697cdf0e10cSrcweir @see osl_getFilePos() 698cdf0e10cSrcweir @see osl_readFile() 699cdf0e10cSrcweir @see osl_writeFile() 700cdf0e10cSrcweir @see osl_setFileSize() 701cdf0e10cSrcweir @see osl_getFileSize() 702cdf0e10cSrcweir */ 703cdf0e10cSrcweir 704cdf0e10cSrcweir oslFileError SAL_CALL osl_openFile( rtl_uString *pustrFileURL, oslFileHandle *pHandle, sal_uInt32 uFlags ); 705cdf0e10cSrcweir 706cdf0e10cSrcweir #define osl_Pos_Absolut 1 707cdf0e10cSrcweir #define osl_Pos_Current 2 708cdf0e10cSrcweir #define osl_Pos_End 3 709cdf0e10cSrcweir 710cdf0e10cSrcweir /** Set the internal position pointer of an open file. 711cdf0e10cSrcweir 712cdf0e10cSrcweir @param Handle [in] 713cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 714cdf0e10cSrcweir 715cdf0e10cSrcweir @param uHow [in] 716cdf0e10cSrcweir Distance to move the internal position pointer (from uPos). 717cdf0e10cSrcweir 718cdf0e10cSrcweir @param uPos [in] 719cdf0e10cSrcweir Absolute position from the beginning of the file. 720cdf0e10cSrcweir 721cdf0e10cSrcweir @return 722cdf0e10cSrcweir osl_File_E_None on success<br> 723cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 724cdf0e10cSrcweir osl_File_E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files<br> 725cdf0e10cSrcweir 726cdf0e10cSrcweir @see osl_openFile() 727cdf0e10cSrcweir @see osl_getFilePos() 728cdf0e10cSrcweir */ 729cdf0e10cSrcweir 730cdf0e10cSrcweir oslFileError SAL_CALL osl_setFilePos( oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uPos ); 731cdf0e10cSrcweir 732cdf0e10cSrcweir 733cdf0e10cSrcweir /** Retrieve the current position of the internal pointer of an open file. 734cdf0e10cSrcweir 735cdf0e10cSrcweir @param Handle [in] 736cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 737cdf0e10cSrcweir 738cdf0e10cSrcweir @param pPos [out] 739cdf0e10cSrcweir On success receives the current position of the file pointer. 740cdf0e10cSrcweir 741cdf0e10cSrcweir @return 742cdf0e10cSrcweir osl_File_E_None on success<br> 743cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 744cdf0e10cSrcweir osl_File_E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files<br> 745cdf0e10cSrcweir 746cdf0e10cSrcweir @see osl_openFile() 747cdf0e10cSrcweir @see osl_setFilePos() 748cdf0e10cSrcweir @see osl_readFile() 749cdf0e10cSrcweir @see osl_writeFile() 750cdf0e10cSrcweir */ 751cdf0e10cSrcweir 752cdf0e10cSrcweir oslFileError SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64 *pPos ); 753cdf0e10cSrcweir 754cdf0e10cSrcweir 755cdf0e10cSrcweir /** Set the file size of an open file. 756cdf0e10cSrcweir 757cdf0e10cSrcweir Sets the file size of an open file. The file can be truncated or enlarged by the function. 758cdf0e10cSrcweir The position of the file pointer is not affeced by this function. 759cdf0e10cSrcweir 760cdf0e10cSrcweir @param Handle [in] 761cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 762cdf0e10cSrcweir 763cdf0e10cSrcweir @param uSize [in] 764cdf0e10cSrcweir New size in bytes. 765cdf0e10cSrcweir 766cdf0e10cSrcweir @return 767cdf0e10cSrcweir osl_File_E_None on success<br> 768cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 769cdf0e10cSrcweir osl_File_E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files<br> 770cdf0e10cSrcweir 771cdf0e10cSrcweir @see osl_openFile() 772cdf0e10cSrcweir @see osl_setFilePos() 773cdf0e10cSrcweir @see osl_getFileStatus() 774cdf0e10cSrcweir @see osl_getFileSize() 775cdf0e10cSrcweir */ 776cdf0e10cSrcweir 777cdf0e10cSrcweir oslFileError SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize ); 778cdf0e10cSrcweir 779cdf0e10cSrcweir 780cdf0e10cSrcweir /** Get the file size of an open file. 781cdf0e10cSrcweir 782cdf0e10cSrcweir Gets the file size of an open file. 783cdf0e10cSrcweir The position of the file pointer is not affeced by this function. 784cdf0e10cSrcweir 785cdf0e10cSrcweir @param Handle [in] 786cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 787cdf0e10cSrcweir 788cdf0e10cSrcweir @param pSize [out] 789cdf0e10cSrcweir Current size in bytes. 790cdf0e10cSrcweir 791cdf0e10cSrcweir @return 792cdf0e10cSrcweir osl_File_E_None on success<br> 793cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 794cdf0e10cSrcweir osl_File_E_OVERFLOW the resulting file offset would be a value which cannot be represented correctly for regular files<br> 795cdf0e10cSrcweir 796cdf0e10cSrcweir @see osl_openFile() 797cdf0e10cSrcweir @see osl_setFilePos() 798cdf0e10cSrcweir @see osl_getFileStatus() 799cdf0e10cSrcweir */ 800cdf0e10cSrcweir 801cdf0e10cSrcweir oslFileError SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64 *pSize ); 802cdf0e10cSrcweir 803cdf0e10cSrcweir 804cdf0e10cSrcweir /** Map flags. 805cdf0e10cSrcweir 806cdf0e10cSrcweir @since UDK 3.2.10 807cdf0e10cSrcweir */ 808cdf0e10cSrcweir #define osl_File_MapFlag_RandomAccess ((sal_uInt32)(0x1)) 809cdf0e10cSrcweir 810cdf0e10cSrcweir /** Map flag denoting that the mapped address space will be accessed by the 811cdf0e10cSrcweir process soon (and it is advantageous for the operating system to already 812cdf0e10cSrcweir start paging in the data). 813cdf0e10cSrcweir 814cdf0e10cSrcweir @since UDK 3.2.12 815cdf0e10cSrcweir */ 816cdf0e10cSrcweir #define osl_File_MapFlag_WillNeed ((sal_uInt32)(0x2)) 817cdf0e10cSrcweir 818cdf0e10cSrcweir /** Map a shared file into memory. 819cdf0e10cSrcweir 820cdf0e10cSrcweir @since UDK 3.2.10 821cdf0e10cSrcweir */ 822cdf0e10cSrcweir oslFileError 823cdf0e10cSrcweir SAL_CALL osl_mapFile ( 824cdf0e10cSrcweir oslFileHandle Handle, 825cdf0e10cSrcweir void** ppAddr, 826cdf0e10cSrcweir sal_uInt64 uLength, 827cdf0e10cSrcweir sal_uInt64 uOffset, 828cdf0e10cSrcweir sal_uInt32 uFlags 829cdf0e10cSrcweir ); 830cdf0e10cSrcweir 831cdf0e10cSrcweir 832cdf0e10cSrcweir /** Unmap a shared file from memory. 833cdf0e10cSrcweir 834cdf0e10cSrcweir @since UDK 3.2.10 835cdf0e10cSrcweir */ 836cdf0e10cSrcweir oslFileError 837cdf0e10cSrcweir SAL_CALL osl_unmapFile ( 838cdf0e10cSrcweir void* pAddr, 839cdf0e10cSrcweir sal_uInt64 uLength 840cdf0e10cSrcweir ); 841cdf0e10cSrcweir 842cdf0e10cSrcweir 843cdf0e10cSrcweir /** Read a number of bytes from a file. 844cdf0e10cSrcweir 845cdf0e10cSrcweir Reads a number of bytes from a file. The internal file pointer is 846cdf0e10cSrcweir increased by the number of bytes read. 847cdf0e10cSrcweir 848cdf0e10cSrcweir @param Handle [in] 849cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 850cdf0e10cSrcweir 851cdf0e10cSrcweir @param pBuffer [out] 852cdf0e10cSrcweir Points to a buffer which receives data. The buffer must be large enough 853cdf0e10cSrcweir to hold uBytesRequested bytes. 854cdf0e10cSrcweir 855cdf0e10cSrcweir @param uBytesRequested [in] 856cdf0e10cSrcweir Number of bytes which should be retrieved. 857cdf0e10cSrcweir 858cdf0e10cSrcweir @param pBytesRead [out] 859cdf0e10cSrcweir On success the number of bytes which have actually been retrieved. 860cdf0e10cSrcweir 861cdf0e10cSrcweir @return 862cdf0e10cSrcweir osl_File_E_None on success<br> 863cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 864cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 865cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 866cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 867cdf0e10cSrcweir osl_File_E_BADF bad file<br> 868cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 869cdf0e10cSrcweir osl_File_E_AGAIN operation would block<br> 870cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 871cdf0e10cSrcweir 872cdf0e10cSrcweir @see osl_openFile() 873cdf0e10cSrcweir @see osl_writeFile() 874cdf0e10cSrcweir @see osl_readLine() 875cdf0e10cSrcweir @see osl_setFilePos() 876cdf0e10cSrcweir */ 877cdf0e10cSrcweir 878cdf0e10cSrcweir oslFileError SAL_CALL osl_readFile( oslFileHandle Handle, void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64 *pBytesRead ); 879cdf0e10cSrcweir 880cdf0e10cSrcweir 881cdf0e10cSrcweir /** Test if the end of a file is reached. 882cdf0e10cSrcweir 883cdf0e10cSrcweir @param Handle [in] 884cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 885cdf0e10cSrcweir 886cdf0e10cSrcweir @param pIsEOF [out] 887cdf0e10cSrcweir Points to a variable that receives the end-of-file status. 888cdf0e10cSrcweir 889cdf0e10cSrcweir @return 890cdf0e10cSrcweir osl_File_E_None on success <br> 891cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 892cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 893cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 894cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 895cdf0e10cSrcweir osl_File_E_BADF bad file<br> 896cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 897cdf0e10cSrcweir osl_File_E_AGAIN operation would block<br> 898cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<p> 899cdf0e10cSrcweir 900cdf0e10cSrcweir @see osl_openFile() 901cdf0e10cSrcweir @see osl_readFile() 902cdf0e10cSrcweir @see osl_readLine() 903cdf0e10cSrcweir @see osl_setFilePos() 904cdf0e10cSrcweir */ 905cdf0e10cSrcweir 906cdf0e10cSrcweir oslFileError SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF ); 907cdf0e10cSrcweir 908cdf0e10cSrcweir 909cdf0e10cSrcweir /** Write a number of bytes to a file. 910cdf0e10cSrcweir 911cdf0e10cSrcweir Writes a number of bytes to a file. 912cdf0e10cSrcweir The internal file pointer is increased by the number of bytes read. 913cdf0e10cSrcweir 914cdf0e10cSrcweir @param Handle [in] 915cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 916cdf0e10cSrcweir 917cdf0e10cSrcweir @param pBuffer [in] 918cdf0e10cSrcweir Points to a buffer which contains the data. 919cdf0e10cSrcweir 920cdf0e10cSrcweir @param uBytesToWrite [in] 921cdf0e10cSrcweir Number of bytes which should be written. 922cdf0e10cSrcweir 923cdf0e10cSrcweir @param pBytesWritten [out] 924cdf0e10cSrcweir On success the number of bytes which have actually been written. 925cdf0e10cSrcweir 926cdf0e10cSrcweir @return 927cdf0e10cSrcweir osl_File_E_None on success<br> 928cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 929cdf0e10cSrcweir osl_File_E_FBIG file too large<br> 930cdf0e10cSrcweir osl_File_E_DQUOT quota exceeded<p> 931cdf0e10cSrcweir osl_File_E_AGAIN operation would block<br> 932cdf0e10cSrcweir osl_File_E_BADF bad file<br> 933cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 934cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 935cdf0e10cSrcweir osl_File_E_IO on I/O errosr<br> 936cdf0e10cSrcweir osl_File_E_NOLCK no record locks available<br> 937cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 938cdf0e10cSrcweir osl_File_E_NOSPC no space left on device<br> 939cdf0e10cSrcweir osl_File_E_NXIO no such device or address<br> 940cdf0e10cSrcweir 941cdf0e10cSrcweir @see osl_openFile() 942cdf0e10cSrcweir @see osl_readFile() 943cdf0e10cSrcweir @see osl_setFilePos() 944cdf0e10cSrcweir */ 945cdf0e10cSrcweir 946cdf0e10cSrcweir oslFileError SAL_CALL osl_writeFile( oslFileHandle Handle, const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64 *pBytesWritten ); 947cdf0e10cSrcweir 948cdf0e10cSrcweir /** Read a number of bytes from a specified offset in a file. 949cdf0e10cSrcweir 950cdf0e10cSrcweir The current position of the internal file pointer may or may not be changed. 951cdf0e10cSrcweir 952cdf0e10cSrcweir @since UDK 3.2.10 953cdf0e10cSrcweir */ 954cdf0e10cSrcweir oslFileError SAL_CALL osl_readFileAt( 955cdf0e10cSrcweir oslFileHandle Handle, 956cdf0e10cSrcweir sal_uInt64 uOffset, 957cdf0e10cSrcweir void* pBuffer, 958cdf0e10cSrcweir sal_uInt64 uBytesRequested, 959cdf0e10cSrcweir sal_uInt64* pBytesRead 960cdf0e10cSrcweir ); 961cdf0e10cSrcweir 962cdf0e10cSrcweir 963cdf0e10cSrcweir /** Write a number of bytes to a specified offset in a file. 964cdf0e10cSrcweir 965cdf0e10cSrcweir The current position of the internal file pointer may or may not be changed. 966cdf0e10cSrcweir 967cdf0e10cSrcweir @since UDK 3.2.10 968cdf0e10cSrcweir */ 969cdf0e10cSrcweir oslFileError SAL_CALL osl_writeFileAt( 970cdf0e10cSrcweir oslFileHandle Handle, 971cdf0e10cSrcweir sal_uInt64 uOffset, 972cdf0e10cSrcweir const void* pBuffer, 973cdf0e10cSrcweir sal_uInt64 uBytesToWrite, 974cdf0e10cSrcweir sal_uInt64* pBytesWritten 975cdf0e10cSrcweir ); 976cdf0e10cSrcweir 977cdf0e10cSrcweir 978cdf0e10cSrcweir /** Read a line from a file. 979cdf0e10cSrcweir 980cdf0e10cSrcweir Reads a line from a file. The new line delimiter is NOT returned! 981cdf0e10cSrcweir 982cdf0e10cSrcweir @param Handle [in] 983cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 984cdf0e10cSrcweir 985cdf0e10cSrcweir @param ppSequence [in/out] 986cdf0e10cSrcweir A pointer pointer to a sal_Sequence that will hold the line read on success. 987cdf0e10cSrcweir 988cdf0e10cSrcweir @return 989cdf0e10cSrcweir osl_File_E_None on success<br> 990cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 991cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 992cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 993cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 994cdf0e10cSrcweir osl_File_E_BADF bad file<br> 995cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 996cdf0e10cSrcweir osl_File_E_AGAIN operation would block<br> 997cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<p> 998cdf0e10cSrcweir 999cdf0e10cSrcweir @see osl_openFile() 1000cdf0e10cSrcweir @see osl_readFile() 1001cdf0e10cSrcweir @see osl_writeFile() 1002cdf0e10cSrcweir @see osl_setFilePos() 1003cdf0e10cSrcweir */ 1004cdf0e10cSrcweir 1005cdf0e10cSrcweir oslFileError SAL_CALL osl_readLine( oslFileHandle Handle, sal_Sequence** ppSequence ); 1006cdf0e10cSrcweir 1007cdf0e10cSrcweir /** Synchronize the memory representation of a file with that on the physical medium. 1008cdf0e10cSrcweir 1009cdf0e10cSrcweir The function ensures that all modified data and attributes of the file associated with 1010cdf0e10cSrcweir the given file handle have been written to the physical medium. 1011cdf0e10cSrcweir In case the hard disk has a write cache enabled, the data may not really be on 1012cdf0e10cSrcweir permanent storage when osl_syncFile returns. 1013cdf0e10cSrcweir 1014cdf0e10cSrcweir @param Handle 1015cdf0e10cSrcweir [in] Handle to a file received by a previous call to osl_openFile(). 1016cdf0e10cSrcweir 1017cdf0e10cSrcweir @return 1018cdf0e10cSrcweir <dl> 1019cdf0e10cSrcweir <dt>osl_File_E_None</dt> 1020cdf0e10cSrcweir <dd>On success</dd> 1021cdf0e10cSrcweir <dt>osl_File_E_INVAL</dt> 1022cdf0e10cSrcweir <dd>The value of the input parameter is invalid</dd> 1023cdf0e10cSrcweir </dl> 1024cdf0e10cSrcweir <br><p><strong>In addition to these error codes others may occur as well, for instance:</strong></p><br> 1025cdf0e10cSrcweir <dl> 1026cdf0e10cSrcweir <dt>osl_File_E_BADF</dt> 1027cdf0e10cSrcweir <dd>The file associated with the given file handle is not open for writing</dd> 1028cdf0e10cSrcweir <dt>osl_File_E_IO</dt> 1029cdf0e10cSrcweir <dd>An I/O error occurred</dd> 1030cdf0e10cSrcweir <dt>osl_File_E_NOSPC</dt> 1031cdf0e10cSrcweir <dd>There is no enough space on the target device</dd> 1032cdf0e10cSrcweir <dt>osl_File_E_ROFS</dt> 1033cdf0e10cSrcweir <dd>The file associated with the given file handle is located on a read only file system</dd> 1034cdf0e10cSrcweir <dt>osl_File_E_TIMEDOUT</dt> 1035cdf0e10cSrcweir <dd>A remote connection timed out. This may happen when a file is on a remote location</dd> 1036cdf0e10cSrcweir </dl> 1037cdf0e10cSrcweir 1038cdf0e10cSrcweir @see osl_openFile() 1039cdf0e10cSrcweir @see osl_writeFile() 1040cdf0e10cSrcweir */ 1041cdf0e10cSrcweir oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle); 1042cdf0e10cSrcweir 1043cdf0e10cSrcweir /** Close an open file. 1044cdf0e10cSrcweir 1045cdf0e10cSrcweir @param Handle [in] 1046cdf0e10cSrcweir Handle to a file received by a previous call to osl_openFile(). 1047cdf0e10cSrcweir 1048cdf0e10cSrcweir @return 1049cdf0e10cSrcweir osl_File_E_None on success<br> 1050cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1051cdf0e10cSrcweir osl_File_E_BADF Bad file<br> 1052cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 1053cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 1054cdf0e10cSrcweir osl_File_E_NOSPC no space left on device<br> 1055cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 1056cdf0e10cSrcweir 1057cdf0e10cSrcweir @see osl_openFile() 1058cdf0e10cSrcweir */ 1059cdf0e10cSrcweir 1060cdf0e10cSrcweir oslFileError SAL_CALL osl_closeFile( oslFileHandle Handle ); 1061cdf0e10cSrcweir 1062cdf0e10cSrcweir 1063cdf0e10cSrcweir /** Create a directory. 1064cdf0e10cSrcweir 1065cdf0e10cSrcweir @param pustrDirectoryURL [in] 1066cdf0e10cSrcweir Full qualified URL of the directory to create. 1067cdf0e10cSrcweir 1068cdf0e10cSrcweir @return 1069cdf0e10cSrcweir osl_File_E_None on success<br> 1070cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1071cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1072cdf0e10cSrcweir osl_File_E_EXIST file exists<br> 1073cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1074cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1075cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1076cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 1077cdf0e10cSrcweir osl_File_E_ROFS read-only file system<br> 1078cdf0e10cSrcweir osl_File_E_NOSPC no space left on device<br> 1079cdf0e10cSrcweir osl_File_E_DQUOT quota exceeded<br> 1080cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 1081cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 1082cdf0e10cSrcweir osl_FileE_IO on I/O errors<br> 1083cdf0e10cSrcweir osl_File_E_MLINK too many links<br> 1084cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 1085cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 1086cdf0e10cSrcweir 1087cdf0e10cSrcweir @see osl_removeDirectory() 1088cdf0e10cSrcweir */ 1089cdf0e10cSrcweir 1090cdf0e10cSrcweir oslFileError SAL_CALL osl_createDirectory( rtl_uString* pustrDirectoryURL ); 1091cdf0e10cSrcweir 1092cdf0e10cSrcweir 1093cdf0e10cSrcweir /** Remove an empty directory. 1094cdf0e10cSrcweir 1095cdf0e10cSrcweir @param pustrDirectoryURL [in] 1096cdf0e10cSrcweir Full qualified URL of the directory. 1097cdf0e10cSrcweir 1098cdf0e10cSrcweir @return 1099cdf0e10cSrcweir osl_File_E_None on success<br> 1100cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1101cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1102cdf0e10cSrcweir osl_File_E_PERM operation not permitted<br> 1103cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1104cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1105cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 1106cdf0e10cSrcweir osl_File_E_NOTEMPTY directory not empty<br> 1107cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 1108cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1109cdf0e10cSrcweir osl_File_E_BUSY device or resource busy<br> 1110cdf0e10cSrcweir osl_File_E_ROFS read-only file system<br> 1111cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 1112cdf0e10cSrcweir osl_File_E_BUSY device or resource busy<br> 1113cdf0e10cSrcweir osl_File_E_EXIST file exists<br> 1114cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 1115cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 1116cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 1117cdf0e10cSrcweir 1118cdf0e10cSrcweir @see osl_createDirectory() 1119cdf0e10cSrcweir */ 1120cdf0e10cSrcweir 1121cdf0e10cSrcweir oslFileError SAL_CALL osl_removeDirectory( rtl_uString* pustrDirectoryURL ); 1122cdf0e10cSrcweir 1123cdf0e10cSrcweir /** Function pointer representing a function that will be called by osl_createDirectoryPath 1124cdf0e10cSrcweir if a directory has been created. 1125cdf0e10cSrcweir 1126cdf0e10cSrcweir To avoid unpredictable results the callee must not access the directory whose 1127cdf0e10cSrcweir creation is just notified. 1128cdf0e10cSrcweir 1129cdf0e10cSrcweir @param pData 1130cdf0e10cSrcweir [in] User specified data given in osl_createDirectoryPath. 1131cdf0e10cSrcweir 1132cdf0e10cSrcweir @param aDirectoryUrl 1133cdf0e10cSrcweir [in] The absolute file URL of the directory that was just created by 1134cdf0e10cSrcweir osl_createDirectoryPath. 1135cdf0e10cSrcweir 1136cdf0e10cSrcweir @see osl_createDirectoryPath 1137cdf0e10cSrcweir */ 1138cdf0e10cSrcweir typedef void (SAL_CALL *oslDirectoryCreationCallbackFunc)(void* pData, rtl_uString* aDirectoryUrl); 1139cdf0e10cSrcweir 1140cdf0e10cSrcweir /** Create a directory path. 1141cdf0e10cSrcweir 1142cdf0e10cSrcweir The osl_createDirectoryPath function creates a specified directory path. 1143cdf0e10cSrcweir All nonexisting sub directories will be created. 1144cdf0e10cSrcweir <p><strong>PLEASE NOTE:</strong> You cannot rely on getting the error code 1145cdf0e10cSrcweir osl_File_E_EXIST for existing directories. Programming against this error 1146cdf0e10cSrcweir code is in general a strong indication of a wrong usage of osl_createDirectoryPath.</p> 1147cdf0e10cSrcweir 1148cdf0e10cSrcweir @param aDirectoryUrl 1149cdf0e10cSrcweir [in] The absolute file URL of the directory path to create. 1150cdf0e10cSrcweir A relative file URL will not be accepted. 1151cdf0e10cSrcweir 1152cdf0e10cSrcweir @param aDirectoryCreationFunc 1153cdf0e10cSrcweir [in] Pointer to a function that will be called synchronously 1154cdf0e10cSrcweir for each sub directory that was created. The value of this 1155cdf0e10cSrcweir parameter may be NULL, in this case notifications will not be 1156cdf0e10cSrcweir sent. 1157cdf0e10cSrcweir 1158cdf0e10cSrcweir @param pData 1159cdf0e10cSrcweir [in] User specified data to be passed to the directory creation 1160cdf0e10cSrcweir callback function. The value of this parameter may be arbitrary 1161cdf0e10cSrcweir and will not be interpreted by osl_createDirectoryPath. 1162cdf0e10cSrcweir 1163cdf0e10cSrcweir @return 1164cdf0e10cSrcweir <dl> 1165cdf0e10cSrcweir <dt>osl_File_E_None</dt> 1166cdf0e10cSrcweir <dd>On success</dd> 1167cdf0e10cSrcweir <dt>osl_File_E_INVAL</dt> 1168cdf0e10cSrcweir <dd>The format of the parameters was not valid</dd> 1169cdf0e10cSrcweir <dt>osl_File_E_ACCES</dt> 1170cdf0e10cSrcweir <dd>Permission denied</dd> 1171cdf0e10cSrcweir <dt>osl_File_E_EXIST</dt> 1172cdf0e10cSrcweir <dd>The final node of the specified directory path already exist</dd> 1173cdf0e10cSrcweir <dt>osl_File_E_NAMETOOLONG</dt> 1174cdf0e10cSrcweir <dd>The name of the specified directory path exceeds the maximum allowed length</dd> 1175cdf0e10cSrcweir <dt>osl_File_E_NOTDIR</dt> 1176cdf0e10cSrcweir <dd>A component of the specified directory path already exist as file in any part of the directory path</dd> 1177cdf0e10cSrcweir <dt>osl_File_E_ROFS</dt> 1178cdf0e10cSrcweir <dd>Read-only file system</dd> 1179cdf0e10cSrcweir <dt>osl_File_E_NOSPC</dt> 1180cdf0e10cSrcweir <dd>No space left on device</dd> 1181cdf0e10cSrcweir <dt>osl_File_E_DQUOT</dt> 1182cdf0e10cSrcweir <dd>Quota exceeded</dd> 1183cdf0e10cSrcweir <dt>osl_File_E_FAULT</dt> 1184cdf0e10cSrcweir <dd>Bad address</dd> 1185cdf0e10cSrcweir <dt>osl_File_E_IO</dt> 1186cdf0e10cSrcweir <dd>I/O error</dd> 1187cdf0e10cSrcweir <dt>osl_File_E_LOOP</dt> 1188cdf0e10cSrcweir <dd>Too many symbolic links encountered</dd> 1189cdf0e10cSrcweir <dt>osl_File_E_NOLINK</dt> 1190cdf0e10cSrcweir <dd>Link has been severed</dd> 1191cdf0e10cSrcweir <dt>osl_File_E_invalidError</dt> 1192cdf0e10cSrcweir <dd>An unknown error occurred</dd> 1193cdf0e10cSrcweir </dl> 1194cdf0e10cSrcweir 1195cdf0e10cSrcweir @see oslDirectoryCreationFunc 1196cdf0e10cSrcweir @see oslFileError 1197cdf0e10cSrcweir @see osl_createDirectory 1198cdf0e10cSrcweir */ 1199cdf0e10cSrcweir oslFileError SAL_CALL osl_createDirectoryPath( 1200cdf0e10cSrcweir rtl_uString* aDirectoryUrl, 1201cdf0e10cSrcweir oslDirectoryCreationCallbackFunc aDirectoryCreationCallbackFunc, 1202cdf0e10cSrcweir void* pData); 1203cdf0e10cSrcweir 1204cdf0e10cSrcweir /** Remove a regular file. 1205cdf0e10cSrcweir 1206cdf0e10cSrcweir @param pustrFileURL [in] 1207cdf0e10cSrcweir Full qualified URL of the file to remove. 1208cdf0e10cSrcweir 1209cdf0e10cSrcweir @return 1210cdf0e10cSrcweir osl_File_E_None on success<br> 1211cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1212cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1213cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1214cdf0e10cSrcweir osl_File_E_PERM operation not permitted<br> 1215cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1216cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1217cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 1218cdf0e10cSrcweir osl_File_E_ROFS read-only file system<br> 1219cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 1220cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 1221cdf0e10cSrcweir osl_File_E_IO on I/O errors<br> 1222cdf0e10cSrcweir osl_File_E_BUSY device or resource busy<br> 1223cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 1224cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 1225cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 1226cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 1227cdf0e10cSrcweir osl_File_E_TXTBSY text file busy<br> 1228cdf0e10cSrcweir 1229cdf0e10cSrcweir @see osl_openFile() 1230cdf0e10cSrcweir */ 1231cdf0e10cSrcweir 1232cdf0e10cSrcweir oslFileError SAL_CALL osl_removeFile( rtl_uString* pustrFileURL ); 1233cdf0e10cSrcweir 1234cdf0e10cSrcweir 1235cdf0e10cSrcweir /** Copy a file to a new destination. 1236cdf0e10cSrcweir 1237cdf0e10cSrcweir Copies a file to a new destination. Copies only files not directories. 1238cdf0e10cSrcweir No assumptions should be made about preserving attributes or file time. 1239cdf0e10cSrcweir 1240cdf0e10cSrcweir @param pustrSourceFileURL [in] 1241cdf0e10cSrcweir Full qualified URL of the source file. 1242cdf0e10cSrcweir 1243cdf0e10cSrcweir @param pustrDestFileURL [in] 1244cdf0e10cSrcweir Full qualified URL of the destination file. A directory is NOT a valid destination file! 1245cdf0e10cSrcweir 1246cdf0e10cSrcweir @return 1247cdf0e10cSrcweir osl_File_E_None on success<br> 1248cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1249cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1250cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1251cdf0e10cSrcweir osl_File_E_PERM operation not permitted<br> 1252cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1253cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1254cdf0e10cSrcweir osl_File_E_ISDIR is a directory<br> 1255cdf0e10cSrcweir osl_File_E_ROFS read-only file system<p> 1256cdf0e10cSrcweir 1257cdf0e10cSrcweir @see osl_moveFile() 1258cdf0e10cSrcweir @see osl_removeFile() 1259cdf0e10cSrcweir */ 1260cdf0e10cSrcweir 1261cdf0e10cSrcweir oslFileError SAL_CALL osl_copyFile( rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL ); 1262cdf0e10cSrcweir 1263cdf0e10cSrcweir 1264cdf0e10cSrcweir /** Move a file or directory to a new destination or renames it. 1265cdf0e10cSrcweir 1266cdf0e10cSrcweir Moves a file or directory to a new destination or renames it. 1267cdf0e10cSrcweir File time and attributes are preserved. 1268cdf0e10cSrcweir 1269cdf0e10cSrcweir @param pustrSourceFileURL [in] 1270cdf0e10cSrcweir Full qualified URL of the source file. 1271cdf0e10cSrcweir 1272cdf0e10cSrcweir @param pustrDestFileURL [in] 1273cdf0e10cSrcweir Full qualified URL of the destination file. An existing directory is NOT a valid destination ! 1274cdf0e10cSrcweir 1275cdf0e10cSrcweir @return 1276cdf0e10cSrcweir osl_File_E_None on success<br> 1277cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1278cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1279cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1280cdf0e10cSrcweir osl_File_E_PERM operation not permitted<br> 1281cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1282cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1283cdf0e10cSrcweir osl_File_E_ROFS read-only file system<br> 1284cdf0e10cSrcweir 1285cdf0e10cSrcweir @see osl_copyFile() 1286cdf0e10cSrcweir */ 1287cdf0e10cSrcweir 1288cdf0e10cSrcweir oslFileError SAL_CALL osl_moveFile( rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL ); 1289cdf0e10cSrcweir 1290cdf0e10cSrcweir 1291cdf0e10cSrcweir /** Determine a valid unused canonical name for a requested name. 1292cdf0e10cSrcweir 1293cdf0e10cSrcweir Determines a valid unused canonical name for a requested name. 1294cdf0e10cSrcweir Depending on the Operating System and the File System the illegal characters are replaced by valid ones. 1295cdf0e10cSrcweir If a file or directory with the requested name already exists a new name is generated following 1296cdf0e10cSrcweir the common rules on the actual Operating System and File System. 1297cdf0e10cSrcweir 1298cdf0e10cSrcweir @param pustrRequestedURL [in] 1299cdf0e10cSrcweir Requested name of a file or directory. 1300cdf0e10cSrcweir 1301cdf0e10cSrcweir @param ppustrValidURL [out] 1302cdf0e10cSrcweir On success receives a name which is unused and valid on the actual Operating System and 1303cdf0e10cSrcweir File System. 1304cdf0e10cSrcweir 1305cdf0e10cSrcweir @return 1306cdf0e10cSrcweir osl_File_E_None on success<br> 1307cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1308cdf0e10cSrcweir 1309cdf0e10cSrcweir @see osl_getFileStatus() 1310cdf0e10cSrcweir */ 1311cdf0e10cSrcweir 1312cdf0e10cSrcweir oslFileError SAL_CALL osl_getCanonicalName( rtl_uString *pustrRequestedURL, rtl_uString **ppustrValidURL); 1313cdf0e10cSrcweir 1314cdf0e10cSrcweir 1315cdf0e10cSrcweir /** Convert a path relative to a given directory into an full qualified file URL. 1316cdf0e10cSrcweir 1317cdf0e10cSrcweir Convert a path relative to a given directory into an full qualified file URL. 1318cdf0e10cSrcweir The function resolves symbolic links if possible and path ellipses, so on success 1319cdf0e10cSrcweir the resulting absolute path is fully resolved. 1320cdf0e10cSrcweir 1321cdf0e10cSrcweir @param pustrBaseDirectoryURL [in] 1322cdf0e10cSrcweir Base directory URL to which the relative path is related to. 1323cdf0e10cSrcweir 1324cdf0e10cSrcweir @param pustrRelativeFileURL [in] 1325cdf0e10cSrcweir An URL of a file or directory relative to the directory path specified by pustrBaseDirectoryURL 1326cdf0e10cSrcweir or an absolute path. 1327cdf0e10cSrcweir If pustrRelativeFileURL denotes an absolute path pustrBaseDirectoryURL will be ignored. 1328cdf0e10cSrcweir 1329cdf0e10cSrcweir @param ppustrAbsoluteFileURL [out] 1330cdf0e10cSrcweir On success it receives the full qualified absoulte file URL. 1331cdf0e10cSrcweir 1332cdf0e10cSrcweir @return 1333cdf0e10cSrcweir osl_File_E_None on success<br> 1334cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1335cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures <br> 1336cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 1337cdf0e10cSrcweir osl_File_E_ACCES permission denied<br> 1338cdf0e10cSrcweir osl_File_E_NOENT no such file or directory<br> 1339cdf0e10cSrcweir osl_File_E_NAMETOOLONG file name too long<br> 1340cdf0e10cSrcweir osl_File_E_OVERFLOW value too large for defined data type<br> 1341cdf0e10cSrcweir osl_File_E_FAULT bad address<br> 1342cdf0e10cSrcweir osl_File_E_INTR function call was interrupted<br> 1343cdf0e10cSrcweir osl_File_E_LOOP too many symbolic links encountered<br> 1344cdf0e10cSrcweir osl_File_E_MULTIHOP multihop attempted<br> 1345cdf0e10cSrcweir osl_File_E_NOLINK link has been severed<br> 1346cdf0e10cSrcweir 1347cdf0e10cSrcweir @see osl_getFileStatus() 1348cdf0e10cSrcweir */ 1349cdf0e10cSrcweir 1350cdf0e10cSrcweir oslFileError SAL_CALL osl_getAbsoluteFileURL( 1351cdf0e10cSrcweir rtl_uString* pustrBaseDirectoryURL, 1352cdf0e10cSrcweir rtl_uString *pustrRelativeFileURL, 1353cdf0e10cSrcweir rtl_uString **ppustrAbsoluteFileURL ); 1354cdf0e10cSrcweir 1355cdf0e10cSrcweir 1356cdf0e10cSrcweir /** Convert a system dependend path into a file URL. 1357cdf0e10cSrcweir 1358cdf0e10cSrcweir @param pustrSystemPath [in] 1359cdf0e10cSrcweir A System dependent path of a file or directory. 1360cdf0e10cSrcweir 1361cdf0e10cSrcweir @param ppustrFileURL [out] 1362cdf0e10cSrcweir On success it receives the file URL. 1363cdf0e10cSrcweir 1364cdf0e10cSrcweir @return 1365cdf0e10cSrcweir osl_File_E_None on success<br> 1366cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1367cdf0e10cSrcweir 1368cdf0e10cSrcweir @see osl_getSystemPathFromFileURL() 1369cdf0e10cSrcweir */ 1370cdf0e10cSrcweir 1371cdf0e10cSrcweir oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *pustrSystemPath, rtl_uString **ppustrFileURL); 1372cdf0e10cSrcweir 1373cdf0e10cSrcweir 1374cdf0e10cSrcweir /** Searche a full qualified system path or a file URL. 1375cdf0e10cSrcweir 1376cdf0e10cSrcweir @param pustrFileName [in] 1377cdf0e10cSrcweir A system dependent path, a file URL, a file or relative directory. 1378cdf0e10cSrcweir 1379cdf0e10cSrcweir @param pustrSearchPath [in] 1380cdf0e10cSrcweir A list of system paths, in which a given file has to be searched. The Notation of a path list is 1381cdf0e10cSrcweir system dependend, e.g. on UNIX system "/usr/bin:/bin" and on Windows "C:\BIN;C:\BATCH". 1382cdf0e10cSrcweir These paths are only for the search of a file or a relative path, otherwise it will be ignored. 1383cdf0e10cSrcweir If pustrSearchPath is NULL or while using the search path the search failed, the function searches for 1384cdf0e10cSrcweir a matching file in all system directories and in the directories listed in the PATH environment 1385cdf0e10cSrcweir variable. 1386cdf0e10cSrcweir The value of an environment variable should be used (e.g. LD_LIBRARY_PATH) if the caller is not 1387cdf0e10cSrcweir aware of the Operating System and so doesn't know which path list delimiter to use. 1388cdf0e10cSrcweir 1389cdf0e10cSrcweir @param ppustrFileURL [out] 1390cdf0e10cSrcweir On success it receives the full qualified file URL. 1391cdf0e10cSrcweir 1392cdf0e10cSrcweir @return 1393cdf0e10cSrcweir osl_File_E_None on success<br> 1394cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1395cdf0e10cSrcweir osl_File_E_NOTDIR not a directory<br> 1396cdf0e10cSrcweir osl_File_E_NOENT no such file or directory not found<br> 1397cdf0e10cSrcweir 1398cdf0e10cSrcweir @see osl_getFileURLFromSystemPath() 1399cdf0e10cSrcweir @see osl_getSystemPathFromFileURL() 1400cdf0e10cSrcweir */ 1401cdf0e10cSrcweir 1402cdf0e10cSrcweir oslFileError SAL_CALL osl_searchFileURL( rtl_uString *pustrFileName, rtl_uString *pustrSearchPath, rtl_uString **ppustrFileURL ); 1403cdf0e10cSrcweir 1404cdf0e10cSrcweir 1405cdf0e10cSrcweir /** Convert a file URL into a system dependend path. 1406cdf0e10cSrcweir 1407cdf0e10cSrcweir @param pustrFileURL [in] 1408cdf0e10cSrcweir A File URL. 1409cdf0e10cSrcweir 1410cdf0e10cSrcweir @param ppustrSystemPath [out] 1411cdf0e10cSrcweir On success it receives the system path. 1412cdf0e10cSrcweir 1413cdf0e10cSrcweir @return 1414cdf0e10cSrcweir osl_File_E_None on success 1415cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid 1416cdf0e10cSrcweir 1417cdf0e10cSrcweir @see osl_getFileURLFromSystemPath() 1418cdf0e10cSrcweir */ 1419cdf0e10cSrcweir 1420cdf0e10cSrcweir oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *pustrFileURL, rtl_uString **ppustrSystemPath); 1421cdf0e10cSrcweir 1422cdf0e10cSrcweir 1423cdf0e10cSrcweir /** Function pointer representing the function called back from osl_abbreviateSystemPath 1424cdf0e10cSrcweir 1425cdf0e10cSrcweir @param ustrText [in] 1426cdf0e10cSrcweir Text to calculate the width for 1427cdf0e10cSrcweir 1428cdf0e10cSrcweir @return 1429cdf0e10cSrcweir The width of the text specified by ustrText, e.g. it can return the width in pixel 1430cdf0e10cSrcweir or the width in character count. 1431cdf0e10cSrcweir 1432cdf0e10cSrcweir @see osl_abbreviateSystemPath() 1433cdf0e10cSrcweir */ 1434cdf0e10cSrcweir 1435cdf0e10cSrcweir typedef sal_uInt32 (SAL_CALL *oslCalcTextWidthFunc)( rtl_uString *ustrText ); 1436cdf0e10cSrcweir 1437cdf0e10cSrcweir 1438cdf0e10cSrcweir /** Abbreviate a system notation path. 1439cdf0e10cSrcweir 1440cdf0e10cSrcweir @param ustrSystemPath [in] 1441cdf0e10cSrcweir The full system path to abbreviate 1442cdf0e10cSrcweir 1443cdf0e10cSrcweir @param pustrCompacted [out] 1444cdf0e10cSrcweir Receives the compacted system path on output 1445cdf0e10cSrcweir 1446cdf0e10cSrcweir @param pfnCalcWidth [in] 1447cdf0e10cSrcweir Function ptr that calculates the width of a string. Can be zero. 1448cdf0e10cSrcweir 1449cdf0e10cSrcweir @param uMaxWidth [in] 1450cdf0e10cSrcweir Maximum width allowed that is retunrned from pfnCalcWidth. 1451cdf0e10cSrcweir If pfnCalcWidth is zero the character count is assumed as width. 1452cdf0e10cSrcweir 1453cdf0e10cSrcweir @return 1454cdf0e10cSrcweir osl_File_E_None on success<br> 1455cdf0e10cSrcweir 1456cdf0e10cSrcweir @see oslCalcTextWidthFunc 1457cdf0e10cSrcweir */ 1458cdf0e10cSrcweir 1459cdf0e10cSrcweir oslFileError SAL_CALL osl_abbreviateSystemPath( 1460cdf0e10cSrcweir rtl_uString *ustrSystemPath, 1461cdf0e10cSrcweir rtl_uString **pustrCompacted, 1462cdf0e10cSrcweir sal_uInt32 uMaxWidth, 1463cdf0e10cSrcweir oslCalcTextWidthFunc pCalcWidth ); 1464cdf0e10cSrcweir 1465cdf0e10cSrcweir 1466cdf0e10cSrcweir /** Set file attributes. 1467cdf0e10cSrcweir 1468cdf0e10cSrcweir @param pustrFileURL [in] 1469cdf0e10cSrcweir The full qualified file URL. 1470cdf0e10cSrcweir 1471cdf0e10cSrcweir @param uAttributes [in] 1472cdf0e10cSrcweir Attributes of the file to be set. 1473cdf0e10cSrcweir 1474cdf0e10cSrcweir @return 1475cdf0e10cSrcweir osl_File_E_None on success<br> 1476cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1477cdf0e10cSrcweir 1478cdf0e10cSrcweir @see osl_getFileStatus() 1479cdf0e10cSrcweir */ 1480cdf0e10cSrcweir 1481cdf0e10cSrcweir oslFileError SAL_CALL osl_setFileAttributes( rtl_uString *pustrFileURL, sal_uInt64 uAttributes ); 1482cdf0e10cSrcweir 1483cdf0e10cSrcweir 1484cdf0e10cSrcweir /** Set the file time. 1485cdf0e10cSrcweir 1486cdf0e10cSrcweir @param pustrFileURL [in] 1487cdf0e10cSrcweir The full qualified URL of the file. 1488cdf0e10cSrcweir 1489cdf0e10cSrcweir @param aCreationTime [in] 1490cdf0e10cSrcweir Creation time of the given file. 1491cdf0e10cSrcweir 1492cdf0e10cSrcweir @param aLastAccessTime [in] 1493cdf0e10cSrcweir Time of the last access of the given file. 1494cdf0e10cSrcweir 1495cdf0e10cSrcweir @param aLastWriteTime [in] 1496cdf0e10cSrcweir Time of the last modifying of the given file. 1497cdf0e10cSrcweir 1498cdf0e10cSrcweir @return 1499cdf0e10cSrcweir osl_File_E_None on success<br> 1500cdf0e10cSrcweir osl_File_E_INVAL the format of the parameters was not valid<br> 1501cdf0e10cSrcweir osl_File_E_NOENT no such file or directory not found<br> 1502cdf0e10cSrcweir 1503cdf0e10cSrcweir @see osl_getFileStatus() 1504cdf0e10cSrcweir */ 1505cdf0e10cSrcweir 1506cdf0e10cSrcweir oslFileError SAL_CALL osl_setFileTime( 1507cdf0e10cSrcweir rtl_uString *pustrFileURL, 1508cdf0e10cSrcweir const TimeValue *aCreationTime, 1509cdf0e10cSrcweir const TimeValue *aLastAccessTime, 1510cdf0e10cSrcweir const TimeValue *aLastWriteTime); 1511cdf0e10cSrcweir 1512cdf0e10cSrcweir 1513cdf0e10cSrcweir /** Retrieves the file URL of the system's temporary directory path 1514cdf0e10cSrcweir 1515cdf0e10cSrcweir @param pustrTempDirURL[out] 1516cdf0e10cSrcweir On success receives the URL of system's temporary directory path. 1517cdf0e10cSrcweir 1518cdf0e10cSrcweir @return 1519cdf0e10cSrcweir osl_File_E_None on success 1520cdf0e10cSrcweir osl_File_E_NOENT no such file or directory not found 1521cdf0e10cSrcweir */ 1522cdf0e10cSrcweir 1523cdf0e10cSrcweir oslFileError SAL_CALL osl_getTempDirURL( rtl_uString **pustrTempDirURL ); 1524cdf0e10cSrcweir 1525cdf0e10cSrcweir 1526cdf0e10cSrcweir /** Creates a temporary file in the directory provided by the caller or the 1527cdf0e10cSrcweir directory returned by osl_getTempDirURL. 1528cdf0e10cSrcweir 1529cdf0e10cSrcweir Creates a temporary file in the directory provided by the caller or the 1530cdf0e10cSrcweir directory returned by osl_getTempDirURL. 1531cdf0e10cSrcweir Under UNIX Operating Systems the file will be created with read and write 1532cdf0e10cSrcweir access for the user exclusively. 1533cdf0e10cSrcweir If the caller requests only a handle to the open file but not the name of 1534cdf0e10cSrcweir it, the file will be automatically removed on close else the caller is 1535cdf0e10cSrcweir responsible for removing the file on success. 1536cdf0e10cSrcweir 1537cdf0e10cSrcweir @param pustrDirectoryURL [in] 1538cdf0e10cSrcweir Specifies the full qualified URL where the temporary file should be created. 1539cdf0e10cSrcweir If pustrDirectoryURL is 0 the path returned by osl_getTempDirURL will be used. 1540cdf0e10cSrcweir 1541cdf0e10cSrcweir @param pHandle [out] 1542cdf0e10cSrcweir On success receives a handle to the open file. If pHandle is 0 the file will 1543cdf0e10cSrcweir be closed on return, in this case ppustrTempFileURL must not be 0. 1544cdf0e10cSrcweir 1545cdf0e10cSrcweir @param ppustrTempFileURL [out] 1546cdf0e10cSrcweir On success receives the full qualified URL of the temporary file. 1547cdf0e10cSrcweir If ppustrTempFileURL is 0 the file will be automatically removed on close, 1548cdf0e10cSrcweir in this case pHandle must not be 0. 1549cdf0e10cSrcweir If ppustrTempFileURL is not 0 the caller receives the name of the created 1550cdf0e10cSrcweir file and is responsible for removing the file, in this case 1551cdf0e10cSrcweir *ppustrTempFileURL must be 0 or must point to a valid rtl_uString. 1552cdf0e10cSrcweir 1553cdf0e10cSrcweir @descr 1554cdf0e10cSrcweir Description of the different pHandle, ppustrTempFileURL parameter combinations. 1555cdf0e10cSrcweir pHandle is 0 and ppustrTempDirURL is 0 - this combination is invalid 1556cdf0e10cSrcweir pHandle is not 0 and ppustrTempDirURL is 0 - a handle to the open file 1557cdf0e10cSrcweir will be returned on success and the file will be automatically removed on close. 1558cdf0e10cSrcweir pHandle is 0 and ppustrTempDirURL is not 0 - the name of the file will be returned, 1559cdf0e10cSrcweir the caller is responsible for opening, closing and removing the file. 1560cdf0e10cSrcweir pHandle is not 0 and ppustrTempDirURL is not 0 - a handle to the open file as well as 1561cdf0e10cSrcweir the file name will be returned, the caller is responsible for closing and removing 1562cdf0e10cSrcweir the file. 1563cdf0e10cSrcweir 1564cdf0e10cSrcweir @return 1565cdf0e10cSrcweir osl_File_E_None on success 1566cdf0e10cSrcweir osl_File_E_INVAL the format of the parameter is invalid 1567cdf0e10cSrcweir osl_File_E_NOMEM not enough memory for allocating structures 1568cdf0e10cSrcweir osl_File_E_ACCES Permission denied 1569cdf0e10cSrcweir osl_File_E_NOENT No such file or directory 1570cdf0e10cSrcweir osl_File_E_NOTDIR Not a directory 1571cdf0e10cSrcweir osl_File_E_ROFS Read-only file system 1572cdf0e10cSrcweir osl_File_E_NOSPC No space left on device 1573cdf0e10cSrcweir osl_File_E_DQUOT Quota exceeded 1574cdf0e10cSrcweir 1575cdf0e10cSrcweir @see osl_getTempDirURL() 1576cdf0e10cSrcweir */ 1577cdf0e10cSrcweir 1578cdf0e10cSrcweir oslFileError SAL_CALL osl_createTempFile( 1579cdf0e10cSrcweir rtl_uString* pustrDirectoryURL, 1580cdf0e10cSrcweir oslFileHandle* pHandle, 1581cdf0e10cSrcweir rtl_uString** ppustrTempFileURL); 1582cdf0e10cSrcweir 1583cdf0e10cSrcweir #ifdef __cplusplus 1584cdf0e10cSrcweir } 1585cdf0e10cSrcweir #endif 1586cdf0e10cSrcweir 1587cdf0e10cSrcweir #endif /* _OSL_FILE_H_ */ 1588cdf0e10cSrcweir 1589cdf0e10cSrcweir 1590