I have a program, which adds one byte of data to a file placed on a file server. I would like to know, how many disk seeks this takes, when the file is opened and closed after writing each byte of data?
I have a program, which adds one byte of data to a file placed on a file server. I would like to know, how many disk seeks this takes, when the file is opened and closed after writing each byte of data?
It depends on how much data about the file / its path is already cached, the gap between opening the file and appending the byte, the gap between appending the byte and closing the file, and whatever else is using the disk / cache at the same time.
Even if you could find all this out, why would you want to know such a thing? Even in the absence of any other I/O, you don't know how long a seek operation will take - that depends on the speed of the disk, the position of the file on the disk and the position of the head when the disk receives the request.
under windows, 0 as by default windows will wait until there is no IO (and thus flush the buffer) or the buffer is full. this is controlled per device under write caching policy.