#I am getting java.nio.file.NoSuchFileException.
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
I uploaded your attachments as Gist.
@cursive kraken
Your question has been closed due to inactivity.
If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.
Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.
When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.
Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.
With enough info, someone knows the answer for sure 👍
In my code I am writing to a file named savedata.txt which is the file getting the java.nio.file.NoSuchFileException error. Otherwise my code is also deleting from this file. In order to delete from that file, I have to use a new file, temp.txt, which I write everything except the line that is deleted into. temp.txt is not getting this error
this is done in 3 methods, the same thing in each method
The exception will indicate which line of your code produced the error. It is presumably that "savedata.txt" does not exist in the call Files.lines(Paths.get("savedata.txt"))
That is a relative path. It is relative to the current folder. And that depends on how it was run.
You could check if it exists and consider that a zero line-count. But if you're expecting it to exist then you might be surprised about where the new FileWriter(...) creates the file.