0

As we know VC's WriteFile() writes data to the specified I/O device in OS(see WriteFile)

I want to know if there is such an api in pure dos for this purpose ? (Using Watcom C...)

Then I found _dos_write() in watcom c library reference page 197(see _dos_write()) and it uses system call 0x40 to write count bytes of data from the buffer pointed to by buffer to the file specified by handle

The count is unsigned type and this means the max file count will be 65535.

My question is: is there any other api which can transfer more than 65536 bytes "once" (like WriteFile() does) in pure DOS ?

P.s. It is NOT about the command prompt in Windows!

liaoo
  • 193
  • 2
  • 15
  • 4
    "Pure DOS" means you pop in a floppy disk and boot MS-DOS. You don't have Pure DOS, but an emulation layer. WriteFile does not belong to Visual C: it is an interface to Windows itself, whether or not Visual C is used. MS-DOS has no WriteFile. What you have there is the AH=0x40 function of INT 21H, a DOS function. DOS is a system for a 16 bit architecture with 16 bit registers, so it's reasonable that it has 16 bit based limits. A 65536 sized write was big in DOS's heyday. – Kaz Oct 21 '13 at 04:28
  • Right about now, you probably want to get a copy of [Ralf Brown's Interrupt List](http://www.cs.cmu.edu/~ralf/files.html). But, at least if memory serves, the answer is no -- to write more than 64K, you have make multiple calls, each writing 64K or less. – Jerry Coffin Oct 21 '13 at 04:30

1 Answers1

1

65535 bytes is only the limit of how many bytes we can write/read in one time with one call. If the file is not closed, then simple call the write/read again with an other location in the ram, then the filecounter will be move to the next 65535 bytes of the file. Like Jerry Coffin said, we just have to use mutiple calls before we close the file with filehandle.

Dirk