In addition to the difference to the documentation this of course leads to an “ArgumentError” in the further using. Is this desired or is this a Julia malfunction?
Thanks for your quick answer. For Julia, it’s of course a difference whether in a string a “/” or a “" character is contained. Under Windows 10 I even get the:”\"
If I now read the directory via pwd(), save it in a variable and then load a file later (by using of this variable), I get the error message mentioned above (or that this string does not describe a “file”). The reason is the “\” sign. If I replace it manually with “/” everything works. But it can’t be a solution, can it?
It would help to include a code snippet that is failing. It’s hard to know exactly what problem you’re having otherwise.
You shouldn’t need to manually replace the \\ with / for things to work. Generally you should be using joinpath to create paths that work on your system, e.g. joinpath(pwd(), "somefile.txt") will create the proper absolute path for "somefile.txt" within your current directory.
cur_dir = pwd()
dateiname ="Text.txt"
datei = open(joinpath(cur_dir, dateiname))
inhalt = readlines(datei)
close(datei)
println(inhalt)
Output:
["Das ist der 1. Text!", "Das ist der 2. Text!", "Das ist der 3. Text!"]