In the book I read, it said that “You should immediately call close() on the FileConnection after a delete(). The FileConnection is no longer valid once the underlying file has been deleted”
But in my program, although I have done deletion, I can still use the instance of reference to the FileConnection.
Why?
Code:fileconnection=(FileConnection) Connector.open("file:///root1/createfile.PNG",Connector.READ_WRITE); fileconnection.create(); fileconnection.delete(); System.out.println(fileconnection.usedSize()); fileconnection.create(); /////////////////////////it rename file but give error fileconnection.rename(“rename.png”);

Reply With Quote

