Get list of files without using sketchPath?
in
Integration and Hardware
•
1 year ago
I would like to continue using Processing for my code/design ideas but I'm having an incredible amount of trouble with getting external files (or data files) into my sketches exported as applets and Mac OS X applications due to discrepancies with the handling of the variable sketchPath. Since dataPath(), dataFile(), sketchFile() etc all use this one variable, sketchPath, I've found that its definition is at the core of my problems.
When running as an Mac app the sketchPath variable cannot be relied upon and most certainly does not use the data folder that is compiled into the .jar residing inside the .app contents.
When running as an applet, either on local machine or on my web server, sketchPath is a null and causes headaches. I've secured the applets so this is not the issue. In the applet source sketchPath is set to:
sketchPath = System.getProperty("user.dir");
Could it be that in recent changes to Java, this is no longer a valid way to set sketchPath for exported applet sketches?
I've not found any help searching the forums or the web and it seems I am alone. Providing code examples are not relevant here since simply calling println(sketchPath); from setup will produce null.
Advice, help, or corrections to the source would be of huge value to my project which requires the loading of word.txt files:
If you agree that this is a processing source code issue, or test and get different results, or you have different experiences using sketchPath in applets or Mac applications, then please, post your comments or recommendations here.
Thank you for taking the time to help.
With gratitude,
JosephKnight.com
1