Skip to content

Support on Windows #7

@Cryingmouse

Description

@Cryingmouse
fn main() {
    let mount = nfs_rs::parse_url_and_mount("nfs://10.128.136.211/dir1?uid=0&gid=0&version=3").unwrap();
    if let Some(obj) = mount.create_path("/dir2/nfs-rs3.txt", 0o664).ok() {
        let contents = "hello rust".as_bytes().to_vec();
        let num_bytes_written = mount.write(&obj.fh, 0, &contents).unwrap_or_default();
        assert_eq!(num_bytes_written as usize, contents.len());
        let bytes_read = mount.read(&obj.fh, 0, 16).unwrap_or_default();
        assert_eq!(&bytes_read, &contents);
    }else {
        println!("create path failed");
    }
}

On Windows platform, when I created with the file name nfs-rs.txt, it works. But when I changed the file name to /dir2/nfs-rs.txt, it does not work (the directory dir2 are ready in NFS server side). After checking the code, I suspected that it might related to the path-clean's behavior on Windows, correct? Is it possible to add this case support on Windows?

By the way, I run the same case with file name /dir2/nfs-rs.txt on Linux platform, it works well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions