MacOS Hidden files on external devices

Still trying to learn MacOS stuff, so please bear with me.

I have a hardware device that uses FAT32 formatted volumes (SD cards). It doesn’t understand the hidden files that MacOS creates, even though (luckily) it ignores them. However, they DO take up space on the drive, and I would LOVE it if MacOS would lay off and stop writing them, but as with all things Apple, you don’t tell Apple how to do things, you just deal with it! :wink:

So, other than write-protecting the drive, is there a way to programmatically, in Xojo, clean up ALL hidden files it creates before ejecting the volume? (I know how to eject the volume, but not how to easily delete all hidden files)

Seems Windows doesn’t create these files, so only an issue with my app on MacOS. My app is cross-platform, btw.

macOS hides files that start with a period. You can see them in Terminal using “ls -d .*”. You could just delete all files and folders that start with a period, either from Terminal or through Xojo. But on later versions of macOS you may need elevated system permissions to delete some of them.

Or for $15 you can get BlueHarvest and let it take care them automatically.

(Edited to correct terminal command)

Understood. Thank you for that info, @jmadren.

This app will be used by all sorts of people with little or no computer knowledge. If they all start with “.” it should be easy enough to delete them.

Whilst @jmadren is correct, I would exercise caution deleting these files. They do have a purpose after all and I would be curious to know how much space they actually use up.

For example, if a Mac user is a little anal (like me) and likes their folders to be displayed in a particular way in the Finder (the Mac equivalent of Windows Explorer) then it is possible to set per-folder or per_drive settings for how you want them to be displayed (e.g: in list mode, icon mode, etc). This information is stored in the .DS_Store file. Whilst deleting the file won’t _break" anything, it might frustrate the end user.

In the last few MacOS versions it’s even simpler.
Just press Command + Shift + . (dot) in the Finder to toggle between showing and hiding invisible files.

2 Likes

BTW: you do not talked about Windows’ .Thumb(s) and init and all other files Windows create as silectly as macOS on volumes.

Each OS have service files.

On the other hands, I have a Lenovo laptopn running Windows 8.1 (for 3 years) and I never set the invisible files set to visible (what for ?).

On macOS, it is possible to set an image as the directory background (when opened on macOS).
Deleting all macOS service files will remove that, and I do not talk about custom icons (custom folder icons for example).

Now, I understand you, seeing tons of (apparently) useless files can be disturbing.

1 Like

Remember we’re talking about a hardware device. How the file layout looks to windows or MacOS is irrelevant.
The hardware device doesn’t use the files and doesn’t need them, and they just take up space on a very small (several kb) internal storage.

nice short cut !
not sure I really NEED to see all the hidden files a lot but its handy when you do

No why would we when the topic is “MacOS Hidden files on external devices” ?