1

I am trying to create a new file on my desktop with the path "Users/username/Desktop/file.txt" but when I try to compile my code I get an error but if I use "../../file.txt" it works fine.

How would I get this to work from the "Users" path?

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
meme
  • 27
  • 8

1 Answers1

3

Try to add / before the path:

"/Users/username/Desktop/file.txt"

That worked for me

hasan
  • 23,067
  • 10
  • 60
  • 96