#how to convert a windows path to posix path

1 messages · Page 1 of 1 (latest)

magic spire
#

I was generating a tar file on windows and confused why it wasn't working on linux until I saw that it was making a file called "folder_a\file_b" on linux instead of a folder and a file

Should I just use std.mem.replaceScalar or is there a way to do it in the standard library?

magic spire
#

I guess I'll just use replaceScalar

if (std.fs.path.sep != std.fs.path.sep_posix) {
    std.mem.replaceScalar(u8, tar_path, std.fs.path.sep, std.fs.path.sep_posix);
}