Copy link to clipboard
Copied
I'm using FileStream to read files in two computers that are connected in a Local Area Network (LAN). I have no problem to read the files when the others computers are connected. I'm checking if the directory exists before writing the file I'm checking if the directory AND the file exists before reading the file.
file_pc1 = new File("//OTHER-PC/Folder/file.csv");
directory = new File("//OTHER-PC/Folder");
if (directory_pc1.exists)
{
stream.open(file_pc1, FileMode.WRITE);
stream.writeUTFBytes(csv.data);
stream.close();
}
if (directory_pc1.exists && file_pc1.exists)
{
stream.open(file_pc1, FileMode.READ);
stream.writeUTFBytes(csv.data);
stream.close();
}
All this works great but if the other computer is not connected, the statements directory_pc1.exists and file_pc1.exists takes a very long time and the app freezes, sometime even sending the "Application is not responding" message from Windows, but it finally responds after a long time.
Is there a fastest way to check if i'm connected to another PC?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Please, view my post, may be can use this tip: https://forums.adobe.com/thread/1876631