nefelimet / JavaSerialComms

Java Serial Communications project for the Computer Networks I course.
0 stars 0 forks source link

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

Open nefelimet opened 3 years ago

nefelimet commented 3 years ago

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.

nefelimet commented 3 years ago

This only happened on txt files. I commented out the creation of txt files in receiveImage(), since it isn't needed anymore. It was only needed in the beginning when we needed to check the image's bytes. I'm labeling this as wontfix since it's not important.