{"id":2032,"date":"2004-03-21T14:55:02","date_gmt":"2004-03-21T17:55:02","guid":{"rendered":"http:\/\/brockerhoff.net\/bb\/viewtopic.php?p=846"},"modified":"2010-05-08T22:24:02","modified_gmt":"2010-05-09T01:24:02","slug":"so-it-goes","status":"publish","type":"post","link":"https:\/\/brockerhoff.net\/blog\/2004\/03\/21\/so-it-goes\/","title":{"rendered":"So it goes&#8230;"},"content":{"rendered":"<p>An aggravating agglomerated aggregate of glitches glommed onto me yesterday. After nearly 10 years without losing any significant data, an errant shell script (in an Open Source project I had just downloaded from the net) removed a goodly part of my Home folder. I noticed things crashing and disappearing, finally deduced what must have been happening, and killed the miscreant task.<\/p>\n<p>Of course, Murphy decreed that no recent backup of these data existed&#8230; the external FireWire drive I had been using for backups turned out to be unreliable over a mont ago and I&#8217;m still searching for a replacement.<\/p>\n<p>The BSD\/Unix underpinnings of Mac OS X imply that many actions that involve command-line stuff fail when confronted with file and folder names that contain characters classic Mac users are prone to use: hyphens, spaces and accented characters all make na\u00efve shell commands go astray. (This rarely if ever affects BSD tools called directly from normal applications, as there&#8217;s no parsing of the actual file names involved, and by Mac OS X all filenames use UTF-8 encoding).<\/p>\n<p>In the days of the public betas and Mac OS X 10.0.x, I recall running into several such glitches, mostly while running Apple&#8217;s now-obsolete Project Builder programming environment. Project Builder (and its successor Xcode) invoke the gcc compiler and associated tools through complex shell scripts, and I still run into snags now and then when accented characters are involved. Still, Xcode has been remarkably tolerant of embedded spaces and for the past year I&#8217;ve consistently used spaces in my current folder names without any trouble; mainly for having the projects I&#8217;m working on list first in my somewhat bloated Home folder.<\/p>\n<p>The leading space, unfortunately, was the cause of the aforementioned shell script interpret a &#8220;remove all nested folders from \/Users\/rainer\/ Test Project\/subfolder\/&#8221; command as &#8220;remove all nested folders from \/Users\/rainer\/, from Test, and from Project\/subfolder&#8221; (paraphrased). There are two ways of writing such things correctly: one is to precede embedded spaces with a backslash, another is to enclose the whole file name in quotes. Because of the somewhat convoluted nature of the shell script, which passed a list of search results to the actual remove command, the author did not consider that the list might not be properly formatted&#8230;<\/p>\n<p>Besides my current project folders my Desktop and Documents folders were removed. On the desktop I kept mostly recently-downloaded items, which can always be downloaded again as soon as I need them. The Documents folder was more painful to lose, as it contained my address book, e-mail folders and several other files that contained ongoing corresponce.<\/p>\n<p>So I spent most of yesterday and today trying to restore my working environment. I tried some disk rescue utilities without success. I wrote a disk image of the volume I keep my Home folder on to an improvised external drive, only to find later that this doesn&#8217;t copy unallocated blocks and is therefore unsuitable for data rescue.<\/p>\n<p>Fortunately, my Home volume was nearly full, meaning my working files had a good chance of having been allocated near the end of the volume &#8211; and indeed some judicious albeit tedious scanning allowed me to recover most of the source files I had been working on for the past month. Whew.<\/p>\n<p>Unfortunately, the same trick won&#8217;t work for e-mail; there&#8217;s just too much of it and the fragments can&#8217;t be fitted together as easily; and a CDR backup I did last month proved unreadable, too. So, if you e-mailed me anything important since Christmas, please send it again; sorry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An aggravating agglomerated aggregate of glitches glommed onto me yesterday. After nearly 10 years without losing any significant data, an errant shell script (in an Open Source project I had just downloaded from the net) removed a goodly part of my Home folder. I noticed things crashing and disappearing, finally deduced what must have been [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[19],"tags":[23,22],"class_list":["post-2032","post","type-post","status-publish","format-standard","hentry","category-software","tag-mac","tag-xcode"],"featured_image_src":null,"author_info":{"display_name":"Rainer Brockerhoff","author_link":"https:\/\/brockerhoff.net\/blog\/author\/rbrockerhoff\/"},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q3Zc-wM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/posts\/2032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/comments?post=2032"}],"version-history":[{"count":0,"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/posts\/2032\/revisions"}],"wp:attachment":[{"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/media?parent=2032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/categories?post=2032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brockerhoff.net\/blog\/wp-json\/wp\/v2\/tags?post=2032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}