SdFat: Does File.write() insert or overwrite data?

Hi, i am currently working with the SdFat library (wich is a really good one, btw) and I do not only to append data to a file, I need to change data in every position of the file. So the combination of File.seek(uint32_t) and File.write(uint8_t) should work out for me. But I need to know wether the write()-function overwrites data or inserts it.

Thank you for your answers, Julian

It overwrites. The rest of the file is left intact.

edit: Here is the contents of a file I used as a test. Initially, it was all "blabla123". I moved the file pointer to 50 and wrote "test". Here is the result.

blabla123
blabla123
blabla123
blabla123
blablatest
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123

SurferTim: It overwrites. The rest of the file is left intact.

edit: Here is the contents of a file I used as a test. Initially, it was all "blabla123". I moved the file pointer to 50 and wrote "test". Here is the result.

blabla123
blabla123
blabla123
blabla123
blablatest
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123

What happened to the EOL characters? From my view, you replaced '1' with 't' and '2' with 'e' and '3' with 's' and '\n' with 't'. But why was there still a EOL evident in your output? Shouldn't your output look like this?

blabla123
blabla123
blabla123
blabla123
blablatestblabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123
blabla123

Chuck.

There is a "\r\n" at the end of each line. The "test" overwrote only the "\r". The newline remained.

blabla123\r\n
blabla123\r\n
blabla123\r\n
blabla123\r\n
blablatest\n
blabla123\r\n
blabla123\r\n
blabla123\r\n

SurferTim:
There is a “\r\n” at the end of each line. The “test” overwrote only the “\r”. The newline remained.

blabla123\r\n

blabla123\r\n
blabla123\r\n
blabla123\r\n
blablatest\n
blabla123\r\n
blabla123\r\n
blabla123\r\n

ok, I thought it was just using /n.

Chuck.