Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Faize

macrumors regular
Original poster
Sep 23, 2011
113
27
I know about the setting for network drives, but is there an equivalent setting for local internal drives (read: Macintosh HD) as well? I'm perfectly happy with losing the ability to customize folders.
 

Faize

macrumors regular
Original poster
Sep 23, 2011
113
27
Situations in which files are sent to/received from Windows and Linux primarily. It's obvious who's using a Mac and I'm tired of hearing from other OS users about their need to clean up after me.
 

9valkyrie

macrumors member
Feb 13, 2024
47
17
Well you also have the ._* files which are usually created when a file is created or copied. Every time I use a drive to transfer half the files are ._* files. It seems as if they unavoidable. In my repos I always add .DS_Store and ._* to gitignore so they aren't transferred. One of my jobs other workers also complained about those files. In Windows and Linux just sort, then delete. Option #1: Before you eject the disk, open Terminal and manually remove those files. Thereby the Windows and Linux boxes won't receive them. Just right click or control-click on the drive and select "New Terminal At Folder". You need to delete after transfers are complete. If it's not a disk or a folder, can you still open a Terminal there? Some network utilities allow the ability to see .* files, so simply delete them after your transfers. Option #2: TAR the files, excluding .DS_Store and ._* during the packing. Windows, Mac, and Linux can all unpack TAR archives.
 
Last edited:

arw

macrumors 65816
Aug 31, 2010
1,236
979
Situations in which files are sent to/received from Windows and Linux primarily. It's obvious who's using a Mac and I'm tired of hearing from other OS users about their need to clean up after me.
You'd probably get more/better ideas if you'd elaborate on your exact workflow / data exchange a bit more.

1. As you said internal drives, working on a USB drive to use the following command is probably not feasible?
Code:
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE

2. How do you "send" files so that they contain .DS_Store files? If you compress them, there are commercial tools like BetterZip that explicitly offer the option to Remove Mac specific stuff from archives:
Or integrate it yourself:

3. While it apparently does not work on internal disks anymore, I'll leave BlueHarvest here anyways:
 
  • Like
Reactions: hobowankenobi

Faize

macrumors regular
Original poster
Sep 23, 2011
113
27
It's a very simple workflow so it totally slipped my mind to mention the details. Basically, it's:

  1. Download a zip file attachment from email
  2. Unzip
  3. Make the necessary modifications
  4. Clean up the .DS_Store files (I often forget this step)
  5. Zip
  6. Attach to email
  7. Send email
Ideally, it'd be best to have a solution within the OS as this is a workplace environment so obtaining third party tools inevitably requires weeks of paperwork and approvals and waiting.
 
Last edited:

fibercut

Suspended
Aug 1, 2024
29
9
I know about the setting for network drives, but is there an equivalent setting for local internal drives (read: Macintosh HD) as well? I'm perfectly happy with losing the ability to customize folders.
download the free to use software TinkerTool and be done using the Terminal!
 

9valkyrie

macrumors member
Feb 13, 2024
47
17
it'd be best to have a solution within the OS

This will zip your directory and exclude the .DS_Store and the ._ files. If you are in Finder next to the title of the folder is an icon (or mouse over and it'll appear). Drag the icon onto Terminal for the "directory/to/folder" portion of the code. You can also repeat that same the process for where you want the zip file.

Bash:
zip -r zipfile directory/to/folder -x \*.DS_Store \*._\*

To verify:

Bash:
zipinfo zipfile | less
 
  • Like
Reactions: Faize

Faize

macrumors regular
Original poster
Sep 23, 2011
113
27
This will zip your directory and exclude the .DS_Store and the ._ files. If you are in Finder next to the title of the folder is an icon (or mouse over and it'll appear). Drag the icon onto Terminal for the "directory/to/folder" portion of the code. You can also repeat that same the process for where you want the zip file.

Bash:
zip -r zipfile directory/to/folder -x \*.DS_Store \*._\*

To verify:

Bash:
zipinfo zipfile | less
Thanks for the script! The unzipped folder is always the same name so I can just hardcode that.
 
  • Like
Reactions: 9valkyrie

9valkyrie

macrumors member
Feb 13, 2024
47
17
The unzipped folder is always the same name so I can just hardcode that.
Yep. I recommend against absolute paths or you're going to have a messy zip file.

Also, if the zip file already exists this snippet will remove .DS_Store from the archive:

Bash:
zip -d zipfile \*.DS_Store \*._\* &>/dev/null
zipinfo zipfile | grep .DS_Store    #If this echoes nothing then it completed successfully.
 
Last edited:
  • Like
Reactions: Faize
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.