Is there a low level call that I can use in a C program to copy a file on a DOS system?
I have tried using either fgets() with fputs() or read() with write() in my C program to copy text files on a DOS system. With multiple text editors, if I use any of them to create the source text file, all bytes in the file will get copied as expected; however, if I use certain text editors (e.g. Brief) to create that source text file, either of those copy solutions will somehow miss what appears to be an EOF byte when performing the copy. Using the DIR command, I can see that the copy has one less byte than the source; however, if I either view the copy with an editor or use TYPE to output the contents of the file to the console, I see nothing missing.
I know that the DOS COPY command copies all bytes without fail. I have tried to use one of the C exec() functions in my program before to call the COPY utility; however, it would silently fail to copy the file. I'd love to know what the DOS COPY command is doing that any solution I have implemented is not doing, and I figure it must be something at a lower level.
I have tried using either fgets() with fputs() or read() with write() in my C program to copy text files on a DOS system. With multiple text editors, if I use any of them to create the source text file, all bytes in the file will get copied as expected; however, if I use certain text editors (e.g. Brief) to create that source text file, either of those copy solutions will somehow miss what appears to be an EOF byte when performing the copy. Using the DIR command, I can see that the copy has one less byte than the source; however, if I either view the copy with an editor or use TYPE to output the contents of the file to the console, I see nothing missing.
I know that the DOS COPY command copies all bytes without fail. I have tried to use one of the C exec() functions in my program before to call the COPY utility; however, it would silently fail to copy the file. I'd love to know what the DOS COPY command is doing that any solution I have implemented is not doing, and I figure it must be something at a lower level.