Utop on WSL cannot find file.ml

I’m trying to use vscode to write .ml files, that I will later run in my vscode terminal, via utop. However whenever I type #use test.ml I get the following message.

Cannot find file test.ml

I’ve tried changing the directory to the correct folder and can still not find it.

#cd "/mnt/c/Users/user1/Documents/OCaml2/";;

I’m running Windows 10, WSL2, Ubuntu with Opam installed.

I’m a complete beginner to all this, so I might just be missing something really obvious. Appreciate the help.

I’m not a WSL user at all but you could try

  1. providing full path, for example, #use "/mnt/c/Users/user1/Documents/OCaml2/test.ml";;
  2. examining contents of the directories, to check that your path is right. For example,
    Sys.command "ls /mnt/c/Users/user1/Documents/OCaml2/";;

Happy hacking!

Both method 1 and 2 worked perfectly, but I’m still confused why it didn’t work to change the target directory. Oh, well, thank you very much!