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

java.io.IOException: close failed: EPERM (Operation not permitted) when we copy file from storage to our ntfs usb devices #127

Open
caiyongnjupt opened this issue Nov 1, 2024 · 2 comments

Comments

@caiyongnjupt
Copy link

Dear developer

We used the ntfs-3g code for our android system, but have some IO error when we copy file from storage to our ntfs usb devices

like

10-18 10:49:12.951 2200 8756 E r : Error copying file
10-18 10:49:12.951 2200 8756 E r : java.io.IOException: close failed: EPERM (Operation not permitted)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:254)
10-18 10:49:12.951 2200 8756 E r : at java.io.FileOutputStream.close(FileOutputStream.java:431)
10-18 10:49:12.951 2200 8756 E r : at sun.nio.ch.FileChannelImpl.implCloseChannel(FileChannelImpl.java:164)
10-18 10:49:12.951 2200 8756 E r : at java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:116)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.cloud.r.d(SourceFile:18)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.FACopyUtils.lambda$copyFileToDestFolder$8(SourceFile:19)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.FACopyUtils.d(Unknown Source:0)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.f.run(Unknown Source:11)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.common.utils.y$g.run(SourceFile:2)
10-18 10:49:12.951 2200 8756 E r : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-18 10:49:12.951 2200 8756 E r : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-18 10:49:12.951 2200 8756 E r : at java.lang.Thread.run(Thread.java:923)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.common.utils.r$a.run(SourceFile:2)
10-18 10:49:12.951 2200 8756 E r : Caused by: android.system.ErrnoException: close failed: EPERM (Operation not permitted)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.Linux.close(Native Method)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.ForwardingOs.close(ForwardingOs.java:88)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.BlockGuardOs.close(BlockGuardOs.java:110)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.ForwardingOs.close(ForwardingOs.java:88)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:252)
10-18 10:49:12.951 2200 8756 E r : ... 12 more

Can you help me ?
thanks

@BOBA1985
Copy link

Dear developer

We used the ntfs-3g code for our android system, but have some IO error when we copy file from storage to our ntfs usb devices

like

10-18 10:49:12.951 2200 8756 E r : Error copying file
10-18 10:49:12.951 2200 8756 E r : java.io.IOException: close failed: EPERM (Operation not permitted)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:254)
10-18 10:49:12.951 2200 8756 E r : at java.io.FileOutputStream.close(FileOutputStream.java:431)
10-18 10:49:12.951 2200 8756 E r : at sun.nio.ch.FileChannelImpl.implCloseChannel(FileChannelImpl.java:164)
10-18 10:49:12.951 2200 8756 E r : at java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:116)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.cloud.r.d(SourceFile:18)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.FACopyUtils.lambda$copyFileToDestFolder$8(SourceFile:19)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.FACopyUtils.d(Unknown Source:0)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.gallery.utils.f.run(Unknown Source:11)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.common.utils.y$g.run(SourceFile:2)
10-18 10:49:12.951 2200 8756 E r : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-18 10:49:12.951 2200 8756 E r : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-18 10:49:12.951 2200 8756 E r : at java.lang.Thread.run(Thread.java:923)
10-18 10:49:12.951 2200 8756 E r : at com.meizu.media.common.utils.r$a.run(SourceFile:2)
10-18 10:49:12.951 2200 8756 E r : Caused by: android.system.ErrnoException: close failed: EPERM (Operation not permitted)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.Linux.close(Native Method)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.ForwardingOs.close(ForwardingOs.java:88)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.BlockGuardOs.close(BlockGuardOs.java:110)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.ForwardingOs.close(ForwardingOs.java:88)
10-18 10:49:12.951 2200 8756 E r : at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:252)
10-18 10:49:12.951 2200 8756 E r : ... 12 more

Can you help me ?
thanks

@jpandre
Copy link
Collaborator

jpandre commented Nov 30, 2024

It would be quite a challenge to provide some ntfs-3g oriented help with no information about how ntfs-3g has been plugged into Java and Android.

On Posix, which ntfs-3g is expected to conform to, close() cannot return EPERM (https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html), but Android and the Java environment may have their say.

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

3 participants