VirtualBox

Changeset 6992 in vbox


Ignore:
Timestamp:
Feb 18, 2008 1:34:17 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28187
Message:

Restrict RTFILE_O_NOT_CONTENT_INDEXED to file creation.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r6984 r6992  
    9494#define RTFILE_O_ACTION_MASK        0x00000300
    9595
    96 /** Turns off indexing of files on Windows hosts.
     96/** Turns off indexing of files on Windows hosts, *CREATE* only.
    9797 * @remark  This might not be implemented on all platforms,
    9898 *          and will be ignored on those.
     
    270270
    271271/**
    272  * Determine the maximum file size. 
    273  * 
    274  * @returns The max size of the file. 
     272 * Determine the maximum file size.
     273 *
     274 * @returns The max size of the file.
    275275 *          -1 on failure, the file position is undefined.
    276  * @param   File        Handle to the file. 
    277  * @see     RTFileGetMaxSizeEx. 
     276 * @param   File        Handle to the file.
     277 * @see     RTFileGetMaxSizeEx.
    278278 */
    279279RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
    280280
    281281/**
    282  * Determine the maximum file size. 
    283  * 
     282 * Determine the maximum file size.
     283 *
    284284 * @returns IPRT status code.
    285  * @param   File        Handle to the file. 
    286  * @param   pcbMax      Where to store the max file size. 
     285 * @param   File        Handle to the file.
     286 * @param   pcbMax      Where to store the max file size.
    287287 * @see     RTFileGetMaxSize.
    288288 */
     
    290290
    291291/**
    292  * Determine the maximum file size depending on the file system the file is stored on. 
    293  * 
    294  * @returns The max size of the file. 
     292 * Determine the maximum file size depending on the file system the file is stored on.
     293 *
     294 * @returns The max size of the file.
    295295 *          -1 on failure.
    296  * @param   File        Handle to the file.         
     296 * @param   File        Handle to the file.
    297297 */
    298298RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
  • trunk/src/VBox/Runtime/r3/fileio.cpp

    r6433 r6992  
    142142#endif
    143143        ||  (fOpen & (RTFILE_O_TRUNCATE | RTFILE_O_WRITE)) == RTFILE_O_TRUNCATE
     144        ||  (   fOpen & RTFILE_O_NOT_CONTENT_INDEXED
     145             && !(   (fOpen & RTFILE_O_ACTION_MASK) == RTFILE_O_OPEN_CREATE
     146                  || (fOpen & RTFILE_O_ACTION_MASK) == RTFILE_O_CREATE
     147                  || (fOpen & RTFILE_O_ACTION_MASK) == RTFILE_O_CREATE_REPLACE))
    144148       )
    145149    {
     
    219223
    220224/**
    221  * Determine the maximum file size. 
    222  * 
    223  * @returns The max size of the file. 
     225 * Determine the maximum file size.
     226 *
     227 * @returns The max size of the file.
    224228 *          -1 on failure, the file position is undefined.
    225  * @param   File        Handle to the file. 
    226  * @see     RTFileGetMaxSizeEx. 
     229 * @param   File        Handle to the file.
     230 * @see     RTFileGetMaxSizeEx.
    227231 */
    228232RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File)
     
    235239
    236240/**
    237  * Determine the maximum file size. 
    238  * 
     241 * Determine the maximum file size.
     242 *
    239243 * @returns IPRT status code.
    240  * @param   File        Handle to the file. 
    241  * @param   pcbMax      Where to store the max file size. 
     244 * @param   File        Handle to the file.
     245 * @param   pcbMax      Where to store the max file size.
    242246 * @see     RTFileGetMaxSize.
    243247 */
    244248RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax)
    245249{
    246     /* 
    247      * Save the current location 
     250    /*
     251     * Save the current location
    248252     */
    249253    uint64_t offOld;
     
    253257
    254258    /*
    255      * Perform a binary search for the max file size. 
     259     * Perform a binary search for the max file size.
    256260     */
    257261    uint64_t offLow  =       0;
    258262    uint64_t offHigh = 8 * _1T; /* we don't need bigger files */
    259     /** @todo r=bird: This isn't doing the trick for windows (at least not vista). 
    260      * Close to offHigh is returned regardless of NTFS or FAT32. 
    261      * We might have to make this code OS specific... 
    262      * In the worse case, we'll have to try GetVolumeInformationByHandle on vista and fall 
     263    /** @todo r=bird: This isn't doing the trick for windows (at least not vista).
     264     * Close to offHigh is returned regardless of NTFS or FAT32.
     265     * We might have to make this code OS specific...
     266     * In the worse case, we'll have to try GetVolumeInformationByHandle on vista and fall
    263267     * back on NtQueryVolumeInformationFile(,,,, FileFsAttributeInformation) else where, and
    264268     * check for known file system names. (For LAN shares we'll have to figure out the remote
    265      * file system.) */ 
     269     * file system.) */
    266270    //uint64_t offHigh = INT64_MAX;
    267271    for (;;)
  • trunk/src/VBox/Runtime/r3/win/fileio-win.cpp

    r6991 r6992  
    231231
    232232    /*
    233      * Turn off indexing of directory through Windows Indexing Service
     233     * Turn off indexing of directory through Windows Indexing Service.
    234234     */
    235235    if (fOpen & RTFILE_O_NOT_CONTENT_INDEXED)
     
    264264
    265265    /*
    266      * Turn off indexing of directory through Windows Indexing Service
     266     * Turn off indexing of directory through Windows Indexing Service.
    267267     */
    268268    if (fOpen & RTFILE_O_NOT_CONTENT_INDEXED)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette