Added 'fpermissive' flag for Unix systems
Change fileIndex from 'int' type to 'DWORD'