Pretty sure you need some #if-ery around this whole function / function body to account for Windows systems