CompuServe Thread

#porting file i/o

2 messages in this thread
#7305From: Rick MartinJul 21, 1993 3:26 PM
Hello All, I am porting some C code to the Mac and running into problems with using the unix compatible file i/o functions (open, write, read, lseek). The operations appear to function (i.e., errno = 0, and proper return codes), but the function doesn't seem to have done its job. For example, open a file, seek to the end and write 1024 bytes to the file. The file is open for read/ write and there is enough disk space. The write returns a zero, which indicates zero bytes written (which is what happened), but there is no explanation for it not having written the entire 1024 bytes. I have copied the code into a small test program and it works fine there, just not in the code I'm porting. I anyone could point me in the write <g> direction, I'd be grateful. Thanks, Rick
#7335From: Rick MartinJul 21, 1993 7:20 PM
I'm back. I solved my own problem, by determining that I had "infer prototypes" set, and there were no actual prototypes for my file i/o functions. As soon as I added unix.h to my code, all was well. Prehaps, this can help someone else. Have fun, Rick