Originally Posted by lord vader
Right now i am learning about disk files in C and i need to know the filename rules and directory stuff for mac os x. If any one could show me were to find this info it would be helpful. :)
File I/O is the same in C for Mac OS X as for other operating systems. (Perhaps I'm not understanding your question?) For example, this code should make a new file called "readme" that contains the text "hello world!"; it should work on a variety of platforms, including a Mac:
Code:
#include <stdio.h>
int main()
{
FILE *fp;
fp = fopen("/Users/yourname/readme", "w");
if (fp)
{
fprintf(fp, "hello world!\n");
fclose(fp);
}
else
{
printf("Could not open the file '/Users/yourname/readme'\n");
}
return 0;
}
[Of course the indentation is all messed up!] If you're trying to find out about the functions for reading from/writing to files in C (fopen, scanf, printf, etc.) then just do a search for "C file I/O" or something like that; I'm sure there are lots of references.