You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't delete folder recursively due to MacOS resource forks (._* files) #4720
Midnight Commander version and build configuration
GNU Midnight Commander 4.8.33
Gebaut mit GLib 2.82.4
Gebaut mit S-Lang 2.3.3 mit terminfo-Datenbank
Gebaut mit libssh2 1.11.1
Mit eingebautem Editor
Mit Subshell-Unterstützung als Standard
Mit Unterstützung für Hintergrundoperationen
Mit Mausunterstützung für xterm
Mit Internationalisierungsunterstützung
Mit Unterstützung mehrerer Codepages
Virtuelles Dateisystem:
cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, shell
Datentypen:
char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64; uintmax_t: 64;
Operating system
Darwin Mac.fritz.box 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041 arm64
Is this issue reproducible using the latest version of Midnight Commander?
I confirm the issue is still reproducible with the latest version of Midnight Commander
How to reproduce
Deleting folder with some files and their pesty ._* counterparts created by MacOS
(recursive delete = yes)
Expected behavior
Folder get's deleted
Actual behavior
n files reside in this folder
having to delete this folder n+1 times until it's really gone
(recursive delete = yes)
Additional context
I think it has to something to do with this stupid .* files, which MacOS creates for every regular file.
When I get rid of these .* files before and try to delete the folder, it works as expected.
Could you provide a sample tree that reproduces the issue? I've never seen anything like that on my Mac. From your description, it seems that you are working with a system that does not support metadata.
64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file1* 64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file2* 64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file3* 0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file1* 0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file2* 0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file3*
Also very strange that I don't see this files in the finder (although I switched on to see hidden files ⇧⌘.)
Addition: happens only on external media as SD-Cards or USB-Sticks. Internal drive is not affected.
No, I meant the actual archive of files that I can unpack and try out on my system... but see below:
Addition: happens only on external media as SD-Cards or USB-Sticks. Internal drive is not affected.
I see. This corroborates my statement above that you are working with file systems that do not support metadata, such as ExFAT. In this case, macOS stores the metadata ("resource fork") in "shadow" files (._*). If an external tool removes the shadow files, the behavior is undefined.
It's possible that we're removing some of those files, and then they're automatically reappearing. I'm not sure what we can do about it. One option is to sort the file listing before removal so that these special files are removed last (at which point they won't exist anyway).
changed the title [-]Can't delete folder recursivly (MacOS ._* files)[/-][+]Can't delete folder recursively due to MacOS resource forks (`._*` files)[/+]on Jun 9, 2025
Activity
zyv commentedon Jun 4, 2025
Could you provide a sample tree that reproduces the issue? I've never seen anything like that on my Mac. From your description, it seems that you are working with a system that does not support metadata.
ollixx77 commentedon Jun 4, 2025
Something like this?
64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file1*64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file2*64 -rwx------ 1 olli staff 4,0K 4 Jun 18:24 ._file3*0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file1*0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file2*0 -rwx------@ 1 olli staff 0B 4 Jun 18:24 file3*Also very strange that I don't see this files in the finder (although I switched on to see hidden files ⇧⌘.)
Addition: happens only on external media as SD-Cards or USB-Sticks. Internal drive is not affected.
zyv commentedon Jun 4, 2025
No, I meant the actual archive of files that I can unpack and try out on my system... but see below:
I see. This corroborates my statement above that you are working with file systems that do not support metadata, such as ExFAT. In this case, macOS stores the metadata ("resource fork") in "shadow" files (
._*). If an external tool removes the shadow files, the behavior is undefined.It's possible that we're removing some of those files, and then they're automatically reappearing. I'm not sure what we can do about it. One option is to sort the file listing before removal so that these special files are removed last (at which point they won't exist anyway).
What do you think, @aborodin?
ollixx77 commentedon Jun 4, 2025
I tried it, but sorting doesn't help 🤷♂️
Does mc care about the sort order, when deleting files in a sub-folder?
zyv commentedon Jun 4, 2025
I'm not talking about the panels' sorting order, but rather the internal order in which mc deletes files.
zyv commentedon Jun 5, 2025
This should properly delete the forks (untested); I'm just not sure what to do about the return status...
[-]Can't delete folder recursivly (MacOS ._* files)[/-][+]Can't delete folder recursively due to MacOS resource forks (`._*` files)[/+]14 remaining items
fixup! fixup! fixup! fixup! Ticket #4720: delete resource forks on ma…
fixup! fixup! fixup! fixup! fixup! Ticket #4720: delete resource fork…
Ticket #4720: delete resource forks on macOS last to avoid recursive …
fixup! Ticket #4720: delete resource forks on macOS last to avoid rec…
fixup! Ticket #4720: delete resource forks on macOS last to avoid rec…
fixup! Ticket #4720: delete resource forks on macOS last to avoid rec…
Ticket #4720: delete resource forks on macOS last to avoid recursive …
Ticket #4720: don't fail on removing files that are already gone
DO NOT MERGE: ci: re-enable all builds, extend ticket #4720 tests
Ticket #4720: skip entries vanished during recursive delete
Ticket #4720: skip entries vanished during deletion process
Merge pull request #4722 from MidnightCommander/4720_macos_delete_forks