Pwd() cd() and I/O text for open files from pc

cd stands for “change directory”, but you’re passing as argument a path to a file (.jl), not to a directory (cartella).

Restart Julia and try the following:

julia> pwd()
"C:\\Users\\Amministratore"

julia> cd(".\\Julia")

julia> pwd()
"C:\\Users\\Amministratore\\Julia"

julia> io = open("myfile.jl", "w");

julia> write(io, "Hello world!");

julia> close(io);

julia> io = open("myfile.jl", "r");

julia> read(io, String)
"Hello world!"

You can also open the file in a text editor and see for yourself that “Hello world!” was written.

Finally, check out this topic: Please read: make it easier to help you.

3 Likes