jmarshall-com commented on issue #393:
URL: 
https://github.com/apache/cordova-plugin-file/issues/393#issuecomment-1030912184


   Exactly this is still happening for me, i.e. when running on iOS only, using 
`FileEntry.copyTo()` onto an existing file results in a `PATH_EXISTS_ERR`.  
Looking into the source code at 
`plugins/cordova-plugin-file/src/iOS/CDVLocalFilesystem.m`, in the 
`copyFileToURL()` routine, lines 493-495 are:
   
   ```
   } else if (bNewExists) {
        // the full destination should NOT already exist if a copy
        errCode = PATH_EXISTS_ERR;
   ```
   
   As @coulson84 notes above, the (now deprecated) standard at W3C says that 
copyTo() should delete an existing destination file before copying.  Should 
this be followed in the source code above?  Or perhaps the plugin's `copyTo()` 
routine should have an `options` argument that allows this?
   
   It's not hard to work around-- on iOS, the app can just delete a destination 
file before copying-- but perhaps this could be fixed for the sake of 
consistency with other platforms, or at a minimum documented under "iOS Quirks".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to