Skip to content

java.io.FileNotFoundException error when writing into txt file #1

@nefelimet

Description

@nefelimet

When receiveImage() tries to write into the txt files, this error occurs:

An error occurred.
java.io.FileNotFoundException: imageWithError.txt (Δεν ήταν δυνατή η προσπέλαση του αρχείου από τη διεργασία, επειδή χρησιμοποιείται ήδη από κάποια άλλη διεργασία)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:291)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:234)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:155)
at java.base/java.io.FileWriter.(FileWriter.java:82)
at userApp.writeToFile(userApp.java:95)
at userApp.receiveImage(userApp.java:170)
at userApp.demo(userApp.java:220)
at userApp.main(userApp.java:19)

However, the program continues execution and does create the txt files correctly. The jpeg files have no problem.
I can just comment out the txt files part since we no longer need it anyway, but it would be nice to know the reason behind this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions