Skip to content

Instantly share code, notes, and snippets.

@stevengj
Created August 3, 2018 21:38
Show Gist options
  • Save stevengj/b531d9ca79aa7e3934929c07ea853e90 to your computer and use it in GitHub Desktop.
Save stevengj/b531d9ca79aa7e3934929c07ea853e90 to your computer and use it in GitHub Desktop.
appdata
function appdata()
path = zeros(UInt32, 300)
result = ccall((:SHGetFolderPathW,:shell32), stdcall, Cint,
(Ptr{Cvoid},Cint,Ptr{Cvoid},Cint,Ptr{UInt8}),C_NULL,0x0005,C_NULL,0,path)
return result == 0 ? transcode(String, resize!(path, findfirst(iszero, path)-1)) : homedir()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment