Write files changes made when opening file through windows explorer in a mapped drive

115 Views Asked by At

I'm implementing a WebDAV file server using the ITHit WebDave engine, i have the following problem

When i list the files and open one of them i get the ReadAsync method called, i provide the content and the file is opened correctly

However any changes i make to the file can't be saved, i get an error saying

A device attached to the system is not working

I looked at the file system samples and implemented support based on the FileSystemStorage.AspNetCore sample,

From what can understand the WriteAsync method is used when creating new files, should i expect for WriteAsync to also be called for file edits that need to be changed?

Am i wrong in the assumption that DavFile.WriteAsync will be called with a stream for the updated content?

If WriteAsync is not the right location to save updates to a file, could you provide some guidance on the process of saving changes to existing files?

Edited to add: Now i can see that after i dismiss the first error about the device not working i get the standard save dialog box, if i click save it asks me if i want to overwrite the existing file, after accepting to overwrite then WriteAsync is called and i can update the file contents

I'm not quite sure why it would first tell me there's an error and then still allow me to write the file but only as replacement to the original file

Thanks for your help

1

There are 1 best solutions below

0
On

Fixed, i found that there were issues with the ILockAsync implementation, reviewing the FileSystemStorage sample helped fix the issue with locking files before writing or updating properties