Leaking Pipes with Swift and External Executables

Observed with MacOS 12.4/Xcode 13.4.1/Swift 5

There are quite a lot of tutorials out there covering the basics of running external executables from within Swift and, with very little effort, it’s quite easy to throw together something like this…

import Foundation

let wrappedUname = Process()
wrappedUname.executableURL = URL(fileURLWithPath: "/usr/bin/uname")
wrappedUname.arguments = ["-v"]
let unameOutputPipe = Pipe()
let unameErrorPipe = Pipe()
wrappedUname.standardOutput = unameOutputPipe
wrappedUname.standardError = unameErrorPipe
do{
    try wrappedUname.run()
} catch {
    print("Unexpected error: \(error).")
}
wrappedUname.waitUntilExit()
let unameOutput = String(decoding: unameOutputPipe.fileHandleForReading.readDataToEndOfFile(), as: UTF8.self)
let unameError = String(decoding: unameOutputPipe.fileHandleForReading.readDataToEndOfFile(), as: UTF8.self)
print("Output: " + unameOutput)
print("Error: " + unameError)
Continue reading

WWDC 2020

As it’s less than a month to the virtual WWDC, it’s time for an Apple/WWDC wish list.

On the MacOS-next side of things:

  • AV1 support baked in (CoreVideo and wherever else it’s needed).
  • APFS idle-time dedup.
  • January’s ‘Pro’ mode rumours coming to fruition.
  • And it’s equal and opposite ‘super battery saver’ mode.
  • Time Machine revamp/APFS based time machine.
  • Internet Time Machine.
  • BetterTouchTool clone. The touch bar remains a very expensive white elephant, this may make it less of a failure for most.

On the iOS side:

  • Options for simultaneous multi lens pictures/video in default camera app.
  • Raw photos option in default camera app.
  • Option to replace default protocol handlers.
  • AV1 support.

Hardware wise:

Not in a million years but I still want:

  • Aperture 4 with local AI powered object recognition, smart photo manipulation/editing, multi drive support and highly configurable iCloud storage options.

The Apple Memory Hole

The (Unofficial) Apple Archive is a newly launched collection of historic Apple media and video.

It must have been a tremendous amount of work collect and catalogue and, for me, the most interesting years are 2004 and 2005 – the years that lead me to purchase my first Mac (and yes, I did buy into PPC after the intel transition was announced!). I doubt it’ll last – Apple’s lawyers must be itching to write takedown notices – but while it’s there it’s an interesting place to poke around.

I still have that old first machine somewhere and I should dig it out; last time I checked (perhaps 5 years ago) it seemed to run ok. I do hope it’s still in something of a functional state.

NetNewsWire

Huzzah! NetNewsWire – the first RSS reader that I ever really used in anger – is back as a modernised and updated open source project! A lack of external sync services marks it out as still quite far from a usable initial release, but, as soon as some of these are added I shall look at moving away from the moribund Reeder and back to NNW as my desktop RSS reader of choice.

Now all we need is for Google to retask the now defunct Google+ team to resurrecting Google Reader and we can all start RSS’ing like it’s 2007 again! After all, without Google+ (or a similar replacement), there is no need for Google to try and kill off the open web in favour of their own walled garden.

(And for anyone searching; the new NetNewsWire agent string is “NetNewsWire (RSS Reader; https://ranchero.com/netnewswire/)”)