c3c icon indicating copy to clipboard operation
c3c copied to clipboard

`std::io::path` - `.` is not a directory

Open ccune opened this issue 1 year ago • 2 comments

On linux-x64, p.str_view() returns blank, path::is_dir(p) returns false.

import std::io;

fn void! main(String[] argv)
{
    Path! p = path::new(".");
    if (catch p)
    {
        io::eprintn("path::new() failed.");
        return;
    }
    io::printfn("'%s' is a directory: %s.", p.str_view(), path::is_dir(p));
}

ccune avatar Mar 09 '24 10:03 ccune

I need to do some research on how to best make this work correct on both Win and Posix

lerno avatar Mar 09 '24 14:03 lerno

What is the desired behaviour? If we think about things like appending and defining such a path. Should there be an "empty path"("") as well as "current path" (".")?

lerno avatar Mar 11 '24 09:03 lerno

This should be fixed in dev now.

lerno avatar Apr 05 '24 09:04 lerno

it works

unereal avatar Apr 26 '24 14:04 unereal