Skip to content

Scoped storage can't RMD non-dir with FX File Explorer #253

@Xavron

Description

@Xavron

Reproduce

Happens with user set to internal dir DCIM. And "/DCIM/eclipse/php-2023-03" is the test dir that won't delete. (There's some other dirs that fail RMD as well.)

Problem

This is because the dir is duplicated in the path here: path + File.separator + finalParam. There's multiple conflicts here of this sort with FX File Explorer. There's several variations on this with a wrong path being created.

  • One problem here is that the working dir may have the param (including a filename here), not the param itself. So that the param needs to be discarded as its of no use.

  • I guess that's another point. The param here is different from the working dir so that only the param is correct. For other conflicts it is not. The working dir here contains a fail so that looking at this, the result becomes incorrect.

This conflicts with other clients as eg Samsung Files, FileZilla, WinSCP. They all delete it successfully.

Other dirs delete fine with FX File Explorer so am not sure why it changes - looks like this may be how the working dir differs from the param. Did not look into it but believe the working dir is not current. Therefore, some dirs may be correct with paths, and some may not be as the working dir may have a file when the current command is to RMD a dir.

FTPS explicit, Android 8.

Not tested against java.io.File. That is separate code so it will have its own things that are not a part of this issue.

Fix

An easy fix has been found and tested to success with no bad conflicts noticed. However, will be doing further testing to make sure of things and possibly some minor code changes if possible. It could still take a while or not. Just no way to know because of how clients heavily conflict here.

Update: I'm exiting programming, dev stuff. Here is the code changes that I had made: Xavron@ddc3e63 . I did not simplify it, nor ran heavily automated tests of the changes (these changes are less likely to cause a regression though). Someone else can do so if wanting to do it. Leaving here for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions