VirtualBox

Changeset 6992 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 18, 2008 1:34:17 PM (17 years ago)
Author:
vboxsync
Message:

Restrict RTFILE_O_NOT_CONTENT_INDEXED to file creation.

Location:
trunk/src/VBox/Runtime/r3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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