We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › folder creation from code
Page Index Toggle Pages: 1
folder creation from code (Read 570 times)
folder creation from code
Jul 25th, 2006, 11:18pm
 
i would like to create a sketch that looks for a specific folder on the users machine... if the folder is not found, the program will create it. is this possible with p5?
Re: folder creation from code
Reply #1 - Jul 26th, 2006, 1:17am
 
Code:
File f=new File("c:\path\to\folder");
f.mkdir();


This will create the folder if it doesn't exist, and do nothing if it does. It'd be more elegant to create the directory relevant to the directory the sketch is run in, but hardcoding the folder name the way shown above works fine.
Re: folder creation from code
Reply #2 - Jul 26th, 2006, 3:06pm
 
see also the createPath() and savePath() functions in the developer's reference.
Page Index Toggle Pages: 1