That didn’t mean we couldn’t take advantage of taking 10+ years of coding experience to refactor the app. If I wanted to support those users with the new version then almost all the new Swift features like SwiftUI were off the table.įor the most part, the migration was a 1:1 code functionality replacement. Versionġ0.12 for example is MacOS Sierra - released in 2016 so an almost 6 year old OS at this point. Looking at the individual (anonymized) TmpDisk usage stats, you can see a very varied spread of OS versions. Pulling data on MacOS version marketshare was actually very hard, and I couldn’t find a reliable source of truth for the ecosystem in general. This post is a (mis)adventure in modernizing an ObjectiveC app in Swift.Įvery MacOS app needs to be targeted at a minimum OS version in order to take advantage of newer language and framework features. Since then the app has been essentially stable with no major feature requests or stability issues prompting the code-base to slowly deteriorate to the point it couldn't even be built on a modern MacOS system. Turns out I wasn’t the only one facing issues and TmpDisk took off, being featured in multiple magazine articles and spread across the web getting hundreds of thousands of downloads. TmpDisk was an app I built back in 2011 to solve an issue I had managing multiple RAM disks that helped with Grunt buildfile speed and cleanup. ![]() I haven't used them, but here are three: TmpDisk, Make Ram Disk, and crd.A journey porting TmpDisk from ObjectiveC to Swift It sounds like previously you could only create a RAM disk up to 2.1 GiB, but that is not the case in Snow Leopard and newer.Īlso, there are tools to help create RAM disks without calculating blocks yourself. dev/disk4 1.5Gi 12Mi 1.5Gi 1% /Volumes/ramdisk dev/disk4 3145728 24696 3121032 1% /Volumes/ramdiskįilesystem Size Used Avail Capacity Mounted on Initialized /dev/rdisk4 as a 2 GB HFS Plus volume $ diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://3145728` To verify, I'll run the following commands: $ hdiutil eject /Volumes/ramdisk/ If you want 1.5 GB (or, perhaps I should say ' GiB', go as follows: 1 bytes 1 blockġ.5 GiB * - * - * - * - = 3145728 blocks ![]() So, the answer is, change the number you specify in the first command, which specified how large the disk is in 512 byte blocks. Note how it shows that the RAM Disk is using 1165424 '512-blocks' (which, if you run df -h, for human readable output, you'll see is '569 Mi'). If you run df to see how much free space is on your disks, you'll get: $ dfįilesystem 512-blocks Used Available Capacity Mounted on The first command creates a block storage device in RAM, and the second command formats it with the standard OS X filesystem. Initialized /dev/rdisk4 as a 569 MB HFS Plus volume $ diskutil erasevolume HFS+ "ramdisk" /dev/disk4 It is actually two commands if you run them individually, you get: $ hdiutil attach -nomount ram://1165430 Here is the one-liner I found to create a ramdisk: diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |