i know that to open an application say notepad the following command is enough
ProcessBuilder proc=new ProcessBuilder("notepad.exe"); and executing
proc.start(); notepad open`s up an untitled file.
But i read that using processbuilder we can open a particular file in notepad with following command ProcessBuilder proc=new ProcessBuilder("notepad.exe","sample");
proc.start(); executing this
if a sample.txt notepad file doesnt exist in the system, notepad would open up and shows a message window asking that "sample.txt doesnt exist, do you want to create?". Well that condition is fine with me.
But before executing proc.start(); if i create a sample.txt file and save it in my desktop. And then upon executing proc.start(); shouldnt the file named sample open up in notepad and show me its content. Rather its still asking me to "do you want to create sample.txt". why is that so even if i had already created the same file before execution ?