{"id":15728649,"url":"https://github.com/pratikpc/wsl-path-rust","last_synced_at":"2025-05-13T04:37:19.922Z","repository":{"id":57672387,"uuid":"406828699","full_name":"pratikpc/wsl-path-rust","owner":"pratikpc","description":"Convert Windows path to WSL2 path and vice-versa ","archived":false,"fork":false,"pushed_at":"2023-03-04T19:51:40.000Z","size":7,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-05-02T08:09:46.412Z","etag":null,"topics":["crates","crates-io","rust","rust-crate","rust-crates","rust-lang","rust-library","wsl","wsl2"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/wslpath","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pratikpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-15T15:39:41.000Z","updated_at":"2025-03-26T02:35:06.000Z","dependencies_parsed_at":"2024-11-23T06:15:40.993Z","dependency_job_id":null,"html_url":"https://github.com/pratikpc/wsl-path-rust","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"ead4f2437297ddaa680aded062b406aef9c4c614"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fwsl-path-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fwsl-path-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fwsl-path-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fwsl-path-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratikpc","download_url":"https://codeload.github.com/pratikpc/wsl-path-rust/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877362,"owners_count":21977634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crates","crates-io","rust","rust-crate","rust-crates","rust-lang","rust-library","wsl","wsl2"],"created_at":"2024-10-03T23:05:12.694Z","updated_at":"2025-05-13T04:37:19.904Z","avatar_url":"https://github.com/pratikpc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WSL Path\n\nYou can use WSLPath to convert a WSL Path to a Windows Path and vice versa\n\n---\n\n## Implementation\n\nCalls [wslpath](https://github.com/MicrosoftDocs/WSL/releases/tag/17046) which is a Linux based utility created by Microsoft to convert Windows and Linux paths.\n\nWe call wslpath, pass arguments, perform a conversion and return the results to the user\n\n---\n\n## Converting Windows Path to WSL Path\n\n```rust\nfn main() {\n\tlet path = wslpath::windows_to_wsl(\"C:\\\\Users\").unwrap();\n\tprintln!(\"Windows Path converted to WSL is {}\",path);\n}\n```\n### OUTPUT\n\u003e Windows Path converted to WSL is /mnt/c/Users\n\n----\n\n## Converting WSL Path to Windows Path\n\n```rust\nfn main() {\n\tlet path = wslpath::wsl_to_windows(\"/mnt/c/Users\").unwrap();\n\tprintln!(\"WSL Path converted to Windows is {}\",path);\n}\n```\n### OUTPUT\n\u003e WSL Path converted to Windows is C:/Users\n\n----\n\n## Converting Windows Path to WSL Path with a specific distro\n\nIn this case we are using Ubuntu\n\n```rust\nfn main() {\n    let path = wslpath::windows_to_wsl_with_distro(\"C:\\\\Users\", \"Ubuntu\".to_string()).unwrap();\n    println!(\"Windows Path converted to WSL is {}\", path);\n}\n```\n### OUTPUT\n\u003e Windows Path converted to WSL is /mnt/c/Users\n\n----\n\n## Converting WSL Path to Windows Path with a specific distro\n\nIn this case we are using Ubuntu\n\n```rust\nfn main() {\n    let path = wslpath::wsl_to_windows_with_distro(\"/mnt/c/Users\", \"Ubuntu\".to_string()).unwrap();\n    println!(\"WSL Path converted to Windows is {}\", path);\n}\n```\n### OUTPUT\n\u003e WSL Path converted to Windows is C:/Users\n\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fwsl-path-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikpc%2Fwsl-path-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fwsl-path-rust/lists"}