Apparently something changed on a recent update. I had a script that used to the following:
hdid -nomount ram://size
newfs_hfs -v “Volume Name” /dev/rdiskX
hdiutil mount /dev/diskX
That doesn’t work any more. It appears that now there is a partition map expected to be on the volume, if you want ‘hdiutil mount /dev/diskX’ to work. You can, alternatively, use ‘mount’ to mount the device. However, if you want to use ‘hdiutil mount’, you can partition the ram disk by doing the following:
disktool partitionDisk diskX 1 HFS+ “Volume Name” <size_in_mb>M
I wish they wouldn’t change behaviors like this so willy-nilly.
In recent months, I’ve decided to really dig into Python and learn the language. This is unusual in that I spend my day generally coding in C for embedded microcontrollers or device drivers. For those that care, yes, I can write C++, Java, Fortran, and a host of other languages too, I just don’t do it on quite the regular basis that I do C, because it is exceptional and well-supported at system level code. However, just about everything I do means writing object-oriented code in a language that isn’t particularly well-suited to describing object-oriented relationships. Python, on the other hand, is at the opposite end of the spectrum: it’s very good at describing those relationships, and in fact, frees you from the entanglements found in statically typed languages such as C++ and Java. So, when it came time to work on a network stack to facilitate testing of some of our devices, I finally made the plunge to learn some of the finer details of Python. This post is about some of the finer details of metaclass programming that I’ve learned. Continue reading ‘Metaclass programming and testing’