13
3
If you use OS X then you might be familiar with the infamous hidden ".DS_Store" files that are produced as a result of using Finder.
The challenge is to write code that will go through the entire file system and delete any file named ".DS_Store".
Classic code golf - shortest code wins.
Clarifications:
The code does not need to delete any .DS_Store files that require superuser; assume no such files exist.
The code should only delete the relevant .DS_Store files and nothing else.
3Does the code need to delete .DS_Store files that require superuser (do I need to invoke sudo)? – Kaya – 2013-05-30T22:08:14.357
1@Kaya Good question: no it does not need to delete such files. – arshajii – 2013-05-30T22:12:33.640
27
Is it okay to delete files not named
– Joey Adams – 2013-05-31T01:55:13.977.DS_Store
also؟And again a chameleon question. – Johannes Kuhn – 2013-05-31T11:56:22.720
1@JohannesKuhn The latest edit should have been self-evident, I would assume. I added it for the sake of completeness. But I appreciate the clever answer, nonetheless! – arshajii – 2013-05-31T12:14:45.547
1@Joey — Transpose the question into the military domain — for example, hmm… the military of the USA, at random ^^ . And replace “file named ".DS_Store"” with “person to kill”. And you will see that the requirement “only” is far from being evident. – Nicolas Barbulesco – 2014-05-30T13:46:46.160