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 & HelpOther Libraries › How can I find library folder in my library
Page Index Toggle Pages: 1
How can I find library folder in my library (Read 1414 times)
How can I find library folder in my library
Apr 9th, 2009, 3:14am
 
I am Building my libray.and I would like to find library folder (<sketchbook folder>/libraies ) in my library codes.
How can I achieve it? I can't find the method in PApplet.I want to use in any platform.so I can't use absolute path.

Thanks.
Re: How can I find library folder in my library
Reply #1 - Apr 9th, 2009, 5:52am
 
Why do you need this path? Processing is supposed to check/find automatically any library there.
Re: How can I find library folder in my library
Reply #2 - Apr 9th, 2009, 6:44am
 
thank you .reply.

My libray need setting file to libray. and , I want to put setting file in same folder.
but I can't find my setting file Path . I can't read setting file.

Re: How can I find library folder in my library
Reply #3 - Apr 9th, 2009, 8:17am
 
use the sketchpath (sketchPath()) folder, or the current folder.. that way, you can have different settings for different projects.. but be sure to create it, and catch all errors incase you don't have writing privileges etc.
Re: How can I find library folder in my library
Reply #4 - Apr 9th, 2009, 1:42pm
 
I fear sketchPath won't help, I feel it will be set on the path to the sketch, not to the library (not tested, I admit).
endo-ta, I asked because some people ask question, but giving another way might be better than solving the question... Smiley
In your case, most libraries bundle (read-only) data files in the jar, so they can be loaded as resources whatever their location.
It might not work for a setting file, I suppose, although it would be the first time I see such file for a library! In general, that's the client (the sketch) which provides settings (and persist them).
Re: How can I find library folder in my library
Reply #5 - Apr 9th, 2009, 4:50pm
 

while running processing, current folder is processing.app folder.so I hung up.

It's very kind of you.

It tries to think again.
Re: How can I find library folder in my library
Reply #6 - Apr 10th, 2009, 2:02am
 
I chose to reload "preferences.txt". and get sketchbook.path.

thank you verymuch
Page Index Toggle Pages: 1