Home | Info | Community | Development | myReactOS | Contact Us
Converts STDIO mode strings into the equivalent FullFAT mode.
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; }