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