Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on IFolder.DeleteAsync() #65

Open
crates-barrels opened this issue Sep 29, 2017 · 1 comment
Open

Crash on IFolder.DeleteAsync() #65

crates-barrels opened this issue Sep 29, 2017 · 1 comment

Comments

@crates-barrels
Copy link

crates-barrels commented Sep 29, 2017

Recently I received a crash report on an iOS device caused by a .DeleteAsync() operation on a folder.
I think this is the result of a new file being added to the folder just moments after the delete procedure was started.

Something like this seems plausible to me:

  1. call to IFolder.DeleteAsync()
  2. this will recursively delete all files in folder
  3. new file is added to folder
  4. .DeleteAsync() tries to delete the folder, but it is not empty because of the new file -> exception is thrown

This is (part of) the crash report I received:
System.IO.Directory.Delete(string path)
System.IO.Directory.RecursiveDelete(string path)
System.IO.Directory.Delete(string path, bool recursive)
PCLStorage.FileSystemFolder.d__26.MoveNext()

@MGohil
Copy link

MGohil commented Oct 11, 2017

I am deleting one folder with name Ex. "FolderABC"
Then I unzip one zip file downloaded from server as name "FolderABC"

Then I am getting following two exceptions (These exceptions are produced in live app only. Debug mode working fine.):

  1. System.IO.DirectoryNotFoundException Could not find a part of the path : 'my directory path'
    System.IO.Directory.GetFiles(string path)
    System.IO.Directory.RecursiveDelete(string path)
    System.IO.Directory.Delete(string path, bool recursive)
    PCLStorage.FileSystemFolder.d__26.MoveNext()

  2. PCLStorage.Exceptions.DirectoryNotFoundException Directory does not exist: /var/mobile/Containers/Data/Application/BD5E7133-EF29-4714-B533-84F92BCBF06E/Documents/MyFolder/FolderABC
    PCLStorage.FileSystemFolder.EnsureExists()
    PCLStorage.FileSystemFolder.d__26.MoveNext()

Is there any workaround to solve this immediately?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants