1

I recently start to use tar to backup my files on macOS.

I usually use:

tar cvf archive.tar foo bar

and i also run this to check:

tar tvf archive.tar 

It would show the following and it seems okay:

-rw-r--r--  0       6 Jan 20 22:40 foo
-rw-r--r--  0      13 Jan 20 22:40 bar

However, It seems likes this on Windows.

-rw-r--r--  0       6 Jan 20 22:40 ._foo
-rw-r--r--  0       6 Jan 20 22:40 foo
-rw-r--r--  0      13 Jan 20 22:40 ._bar
-rw-r--r--  0      13 Jan 20 22:40 bar

I'm confused about the result.

Why it would output ._foo and ._bar? Where are they from?

How could i make an archive.tar only output foo and bar without ._foo and ._bar?

carol
  • 31
  • 2
    You're probably seeing the resource forks/extended attributes, that Windows doesn't know what to do with. The Mac would wrap them back into the file. See https://superuser.com/questions/119928/weird-bug-in-tar-not-including-files-named-init-py and https://superuser.com/questions/104500/what-is-macosx-folder – Tetsujin Jan 20 '24 at 14:21
  • @Tetsujin Thank you for your comment! It really help me a lot:) – carol Jan 20 '24 at 15:36
  • @Kamil Maciorowski Thank you for advice, i answer my own question, and i don't need futher help. – carol Jan 20 '24 at 15:41

1 Answers1

2

It's indeed about extended attributes, and i export the following variable:

export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true

Now it wouldn't output ._file on windows.

carol
  • 31