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