/***************************************************************************** Identifies illegal characters in filenames by attempting to create files with names containing each character. This code is public domain (no copyright). You can do whatever you want with it. *****************************************************************************/ #include #include #if defined(__TURBOC__)||defined(__WATCOMC__) #include #elif defined(__GNUC__) #include #include #endif /***************************************************************************** *****************************************************************************/ int main(void) { char buf[16]; int i, j; printf("These characters are illegal for file names:\n"); for(i = ' '; i < 256; i++) { sprintf(buf, "%c", i); j = creat(buf, S_IWRITE); if(j >= 0) { close(j); unlink(buf); } else printf("%c (0x%02X) ", i, i); } printf("\n"); return 0; }