dataPath("") isn't working, and neither are loadStrings() or loadImage()
in
Integration and Hardware
•
2 months ago
Hey there guys. I'm having a problem with processing that I've never had before. I'm running the newest version of processing (2.0.1) on Mac OS 10.8.4 and have tried reinstalling processing to no avail.
The problem is that I can only use loading functions, like loadStrings() and loadImage(), by passing them the absolute path of the files I want to load. Placing them in the "data" folder inside the sketch directory doesn't work -- I get the warning
"The file "test.txt" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable."
Also, when I call dataPath("") inside setup it returns nonsense. Here's an example
- void setup() {
- // String[] lines = loadStrings("test.txt");
- println(dataPath(""));
- }
The following is printed to the console /Applications/data This directory doesn't exist on my machine... I have tried this on my mom's MacBook and dataPath(""), loadStrings() and loadImage() behave as expected.
Has anyone experienced this before? Does anyone know how I might go about fixing it? Thanks!
1