Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std(os/windows): Add GetTempPathW and GetTempPath #16005

Closed
wants to merge 2 commits into from

Commits on Jun 11, 2023

  1. std(os/windows): Add GetTempPathW and GetTempPath

    This change adds a kernel32.GetTempPathW binding to [GetTempPathW][1].
    This function returns the system path for temporary directories
    (e.g. 'C:\Temp\').
    
    [1]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw
    
    The accompanying windows.GetTempPath function produces a UTF-8 string,
    exposing an API with a similar pattern to GetCurrentDirectory.
    abhinav committed Jun 11, 2023
    Configuration menu
    Copy the full SHA
    407f72b View commit details
    Browse the repository at this point in the history
  2. os/windows: Share UTF-16LE to UTF-8 logic

    GetCurrentDirectory and GetTempPath duplicate the same logic
    to convert a UTF-16LE encoded string into a UTF-8 encoded string.
    
    Extract this logic into a function and reuse it in both places.
    abhinav committed Jun 11, 2023
    Configuration menu
    Copy the full SHA
    a8e8936 View commit details
    Browse the repository at this point in the history