|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Dec 2001
Città: Lecce
Messaggi: 3936
|
[Java] delete()
Ho questo codice:
Codice:
Runtime r = Runtime.getRuntime();
String[] cmd = { "cmd.exe", "/c", "start", "c:\\prova.bat" };
Process p = r.exec(cmd);
p.waitFor();
p.destroy();
test.delete();
r.exit(0);
credevo potese andare bene anche deleteonexit() ma niente da fare |
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Jan 2006
Messaggi: 92
|
Ma quale file scusa????
test è un file??? Controlla se chiudi lo stream prima di eliminarlo! Potresti anche usare la un file temporaneo che viene eliminato automaticamente a fine procedura!
__________________
L'unico computer sicuro è un computer spento!!! |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 15:22.



















