Braces

Yesterday I took the plunge, after that silent advice you get from a dentist that says a lot more than actual words, and got braces for the next two years. Hopefully it will resolve longstanding issues I’ve had with crowding, cleaning and eating, not least root canal on two molars.

Today, I’m in a small amount of pain. I slept quite well, considering I have what feels like a trellis on my teeth. Every now and then, when the top and bottom incisors touch, both teeth tell my brain “don’t do that”.

Eating is a chore. It took about five minutes to eat a banana this morning, by slicing it up. Lunch was equally time-consuming. There’s no way I can chew anything for a while yet, given the tiny amounts of room in my mouth for any sort of grinding motion. I find chopping things up really small and just swallowing them, seems to work the best.

I also hate the toothbrush they gave me. It vibrates and you’re supposed to just hold it against your teeth and let it work. Maybe I’ll get used to it eventually. I’ve got another two years of this.

Symbolic links and Microsoft OneDrive on OS X Mavericks

I ran into an interesting problem recently, which I only resolved today though a bit of trickery.

With the release of OneDrive, Microsoft replaced the existing SkyDrive application on OS X with a new binary. It still refers to the same ~/SkyDrive folder on the file system, but it’s definitely different.

One of the major ways I found this out is how it handles symbolic links (spoiler: it doesn’t).

Because I have (unfortunate) experience with backups, I use several cloud storage vendors, including Dropbox and SkyDriveOneDrive.

I don’t have unlimited disk space though, so I use symbolic links on OS X, and directory junctions on Windows, to map certain folders to these different vendor paths, to avoid duplication and have multiple backups of the same data.

With the new version of OneDrive, symbolic links don’t get followed. Instead, for a sample directory size of 5GB, your CPU goes mad, I/O on your hard drive goes mad, because it’s writing this to the log file all the time:

03-25-2014 17:03:11.769 - fileSystem.cpp:200!openFileRead (ERROR): openFileRead /Users/myUserAccount/SkyDrive/Desktop/filename failed. errno: 1
03-25-2014 17:03:11.769 - localChanges.cpp:1729!startLocalChangeHash (DETAIL): Opening hash handle -1 for file '/Users/myUserAccount/SkyDrive/Desktop/filename'
03-25-2014 17:03:11.769 - localChanges.cpp:1733!startLocalChangeHash (NORMAL): openFileRead failed on /Users/myUserAccount/SkyDrive/Desktop/filename, err 1
03-25-2014 17:03:11.769 - localChanges.cpp:2274!handleLocalReplaceFile (ERROR): Transient Error (REPLACE_FILE_COULD_NOT_OPEN): postponing replace file'C30E03CFF2436B47!44000' because the file could not be opened; ignoreMissingFile=TRUE. Attempt 1

So I decided to try out hard links instead. Using the following source, I created the following C program, and compiled it, from the accepted answer:

#include <unistd.h>
#include <stdio.h>

int main(int argc, char* argv[]) {
 if (argc != 3) {
  fprintf(stderr,"Use: hlink <src_dir> <target_dir>\n");
  return 1;
 }
 int ret = link(argv[1],argv[2]);
 if (ret != 0)
  perror("link");
 return ret;
}

Take into account that the hard linked directories may not be in the same parent directory, so you can do this:

$ gcc hlink.c -o hlink
$ mkdir child1
$ mkdir parent
$ ./hlink child1 parent/clone2

So there you have it. Creating the hard links fixed it immediately. When OneDrive was restarted, it saw the folders as real (because they are), and synchronised everything almost immediately.