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

[bug] Various methods have File related bugs impacting old DocumentFile use like rename #213

Open
Xavron opened this issue Jan 19, 2024 · 0 comments

Comments

@Xavron
Copy link

Xavron commented Jan 19, 2024

Somewhat dated but if a certain upcoming pull request gets added then this easily becomes an option again.

Example:

https://github.com/ppareit/swiftp/blob/267ea09ad89a491d7be7a1dd170f07d45aa05dc6/app/src/main/java/be/ppareit/swiftp/utils/FileUtil.java#L176C1-L178C22

    private static boolean rename(File source, File target) {
        source.renameTo(target);
        return false;
    }

So, on Android 8, that is actually successful but returns false and then DocumentFile code runs to try again which can cause issues.

There's other methods that get into other possible issues like that in similar type methods. Should correct that as possibly more. I didn't directly look into others but had noticed various oddities happening.

Newer scoped storage code, if the pull requests are added, avoid this as I moved them above.

Can be closed if old DocumentFile code is to be left alone and only using new code instead for fixes.

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

1 participant