"Ivan Peevski" <cyberhorse at gmail.com> wrote: > + if (pmode & (MSVCRT__S_IREAD & !MSVCRT__S_IWRITE)) > + attrib |= FILE_ATTRIBUTE_READONLY; The pmode flags test doesn't look right. Also the 'attrib |= ' line has a trailing space. -- Dmitry.