Hi,
I'm writing some assembly routines to replace cc65's fread and fwrite, because those library functions need 2k of code, presumably mostly to emulate the exact behaviour of the C library functions.
I'm testing in VICE because I don't have a 1541.
This is standard VICE-behaviour. You should disable the "Write .P00"-option in "Settings-Peripherhal settings" in VICE. Then it will always overwrite the same file. However for a real 1541 this will provide a "FILE EXISTS" error. So you have to use the @: option to overwrite the file, but since this is buggy in the 1541 the only safe way is to delete the file before writing it.