Dynamic Home Folder

Hello,

How would I dynamically refer to a home folder? I’m setting a default ofDirectory path, however if the app is used on a different machine the home folder will of course be different.

Was wondering if there was something I could replace it with to accommodate for this?

Thanks,

A

Hi,
at least on mac osx you can refer to the home folder by using the tilde character ~
The following code should print to the console all the items of the home folder.

ofDirectory dir;
dir.listDir("~");
for (int i = 0; i < dir.size(); i++) {
	cout << dir.getPath(i) << endl;
}

best!

Perfect! Thanks