1

For some reason, whenever I download a file on a Mac and then navigate to the file on a Windows PC, the file is always accompanied by a hidden file with exactly the same name as the downloaded file (right down to the file extension) except for an additional “._” tacked onto the beginning.

So, for instance, I download

  • Teddy.png

on a Mac, and, when I go to the file’s location in Windows Exploder, I see

  • Teddy.png
  • ._Teddy.png [hidden file]

These extra hidden files are always exactly 4 KiB (4096 B) in size, no matter what the size of the original downloaded file.

This happens on Windows 8.1...

W8.1 phantom files

...on Windows 7...

W7 phantom files

...on Windows XP...

WXP phantom files

...and on Windows 2000.

W2000 phantom files

(It probably happens on other Windows versions as well, but these are the ones I’ve specifically encountered it with.)

This never happens with files downloaded on a Windows PC, no matter what version of Windows said PC is running.

Deleting these phantom 4-KiB hidden files is a pain in the ass, especially if I’ve been downloading a lot of files recently (and thus ending up with a lot of these phantom files).

Why is Windows generating these extra useless files whenever it encounters a file downloaded on a Mac, and how do I stop it from doing so?

(The drive the files are being saved to is a 64-GB exFAT-formatted USB3 flashdrive, if that helps.)

3
  • I wonder if it IS tge PC. Id speculate its.the mac writing metadata of some sort which it would normally put in the filesystem but cant?
    – davidgo
    Mar 7, 2019 at 4:31
  • 1
    all filenames starting with . (dot) will be hidden in macos Mar 7, 2019 at 8:11
  • Could you crop the screenshots in your question? It'll make the images bigger and remove distractions.
    – mwfearnley
    May 20, 2019 at 10:20

1 Answer 1

3

FAT32 and ExFAT cannot store all the information about a file that HFS+, JHFS+ and AFPS can, such as extended attributes or the legacy resource fork. (For example, macOS uses an xattr to mark downloaded files as "quarantined".)

On those file systems, macOS (OS X) itself will create a separate file to hold this information, known as the "AppleDouble" file. You can remove these files by using the Terminal application command called dot_clean. Below is the man page.

DOT_CLEAN(1)              BSD General Commands Manual             DOT_CLEAN(1)

NAME
     dot_clean -- Merge ._* files with corresponding native files.

SYNOPSIS
     dot_clean [-fmnsv] [--keep=[mostrecent|dotbar|native]] [dir ...]

DESCRIPTION
     For each dir, dot_clean recursively merges all ._* files with their cor-
     responding native files according to the rules specified with the given
     arguments.  By default, if there is an attribute on the native file that
     is also present in the ._ file, the most recent attribute will be used.

     If no operands are given, a usage message is output.  If more than one
     directory is given, directories are merged in the order in which they are
     specified.

OPTIONS
     -f      Flat merge.  Do not recursively merge all directories in the
             given dir.  This is off by default.

     -h      Help. Prints verbose usage message.

     -m      Always delete dot underbar files.

     -n      Delete dot underbar file if there is no matching native file.

     -s      Follow symbolic links.  This will follow symbolic dot underbar
             files when they are found.

     -v      Print verbose output.

     --keep=mostrecent
             The default option.  If an attribute is associated with a data
             fork, use that.  Otherwise, use information stored in the Apple-
             Double file.  Note that the native fork’s data is preferred even
             if the data in the AppleDouble file is newer.

     --keep=dotbar
             Always use information stored in the AppleDouble file, replacing
             any extended attributes associated with the native file.

     --keep=native
             Always use the information associated with the data fork, ignor-
             ing any AppleDouble files.

EXAMPLES
     The following is how to do an dot_clean merge on the mounted volume test,
     always using the dot underbar information.

           dot_clean --keep=dotbar /Volumes/test

DIAGNOSTICS
     The dot_clean utility exits 0 on success, and >0 if an error occurs.

BUGS
     None known.

BSD                              Sept 27, 2012                             BSD

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .