AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[newbie] - Gestione file su HD

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
Ciccio Pasticcio
Guest





PostPosted: Thu Jun 23, 2005 3:42 pm    Post subject: [newbie] - Gestione file su HD Reply with quote



Qualcuno mi può dare un dritta plz?
non riesco a trovare nessuna guida a riguardo e programmo in java solo da
pochi giorni.
Volevo sapere come fare un programma che crea file con nomi"sequenziali",
nel senso che all'inizio crea un file Nome001, se esiste crea il file
Nome002 ecc.
Ho visto che esiste il comando exista() ma non ho capito bene come funzione,
anche perchè se non ho capito male la classe File crea un puntatore ad un
file, non il file vero e prorprio.
Grazie per l'aiuto


Back to top
pioneer@inwind.it
Guest





PostPosted: Thu Jun 23, 2005 3:53 pm    Post subject: Re: - Gestione file su HD Reply with quote



Un metodo (probabilmente si può fare anche di meglio) è

File nuovoFile;

for (int i=1;i>0;i++){

if (!new File("Nome"+i).exists()){
nuovoFile = new File("Nome"+i);
i= -1;
}
}

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.