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

os.mkdir() on Windows 11 creates a different named directory than specified by path #23655

Open
fluxprox opened this issue Feb 5, 2025 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@fluxprox
Copy link

fluxprox commented Feb 5, 2025

Describe the bug

My base development environment is Linux but I'm working on cross platform tooling in V and discovered that on Windows 11 os.mkdir(path) is creating a directory that does not match the specified path.

Reproduction Steps

import os

fn main() {
    path := os.abs_path('newdir')
    if !os.exists(path) {
        os.mkdir('newdir')
    }
}

Expected Behavior

Windows should have created the directory specified by path 'newdir'

Current Behavior

Windows created a directory named 'C' instead of 'newdir'

Possible Solution

Temporary work around was to directly use C.CreateDirectory() on Windows without converting the path string using to_wide()

import os

fn main() {
    path := os.abs_path('newdir')
    if !os.exists(path) {
        $if windows {
            C.CreateDirectory(path.str, 0)
        }
    }
}

Additional Information/Context

No response

V version

V 0.4.9 81fd0db.eecaa64

Environment details (OS name and version, etc.)

|:-------------------|:-------------------
|OS                  |windows,
|Processor           |8 cpus, 64bit, little endian, N/A
|Memory              |6.87GB/15.52GB
|            
|V last modified time|2025-02-05 04:04:51
|
|Git version         |git version 2.47.1.windows.2
|V git status        |weekly.2025.05-17-geecaa64e
|.git/config present |true
|                    |
|cc version          |N/A
|gcc version         |N/A
|clang version       |N/A
|msvc version        |N/A
|tcc version         |tcc version 0.9.27 (x86_64 Windows)
|tcc git status      |thirdparty-windows-amd64 b425ac82
|emcc version        |N/A
|glibc version       |N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@fluxprox fluxprox added the Bug This tag is applied to issues which reports bugs. label Feb 5, 2025
Copy link

Connected to Huly®: V_0.6-22075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant