ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Converts STDIO mode strings into the equivalent FullFAT mode.

Parameters:
ModeThe mode string e.g. "rb" "rb+" "w" "a" "r" "w+" "a+" etc
Returns:
Returns the mode bits that should be passed to the FF_Open function.

Definition at line 59 of file ff_file.c.

                                           {
    FF_T_UINT8 ModeBits = 0x00;
    while(*Mode) {
        switch(*Mode) {
            case 'r':   // Allow Read
            case 'R':
                ModeBits |= FF_MODE_READ;
                break;

            case 'w':   // Allow Write
            case 'W':
                ModeBits |= FF_MODE_WRITE;
                ModeBits |= FF_MODE_CREATE; // Create if not exist.
                ModeBits |= FF_MODE_TRUNCATE;
                break;

            case 'a':   // Append new writes to the end of the file.
            case 'A':
                ModeBits |= FF_MODE_WRITE;
                ModeBits |= FF_MODE_APPEND;
                ModeBits |= FF_MODE_CREATE; // Create if not exist.
                break;

            case '+':   // Update the file, don't Append!
                ModeBits |= FF_MODE_READ;   // RW Mode
                ModeBits |= FF_MODE_WRITE;  // RW Mode
                break;

            /*case 'D': // Internal use only!
                ModeBits |= FF_MODE_DIR;
                break;*/

            default:    // b|B flags not supported (Binary mode is native anyway).
                break;
        }
        Mode++;
    }

    return ModeBits;
}

Generated on Sat May 26 2012 06:00:03 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.