-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ofDirectory::createDirectory recursive gives an unnecessary warning #4258
Comments
i've been testing this and it's working for me fine without the warning. i've this PR: #4259 which adds tests, by now to the filesystem parts of OF, and even on osx everything passes fine. i've created a specific test for this but can't get it to fail. you can see the results here: https://travis-ci.org/openframeworks/openFrameworks/jobs/75816086 at the end of that there's the results from the unit tests. perhaps you can use that test app to figure out a case in which it goes wrong? i can merge it into master if that makes it easier |
the function call is working (so it's making the folder) which might means it passes the test but there's a spurious warning (since create_directories is returning false, even though it is creating directories). I tried it locally to the data path (as your test) but I still see the warning:
anyway, it's something that we can code around in "createDirectory" but flagging it if it's a symptom of something larger. I think an easy fix is to check if the directory exists before the operation (ofDirectory::createDirectory) and not use the success value to warn on. |
yes, but i don't get the warning either in the tests and if i create the directory it's detecting it correctly and warning so not sure what might be going on |
ok so digging into this abit more, I wonder if createDirectories returns false if any of the directories in the path already exist -- on OSX, if I comment out ofToDataPath() which adds ../../../data/ I start seeing success as true (ie, it's creating paths inside the bundle near the actual executable) but with ../../../data/ before paths I see success as false even if the final directory is made.... I'm not 100% sure about this, just a theory. |
that's really strange, even calling ofToDataPath with and without absolute paths it's working without warnings in the tests: i've done other fixes in that branch and although i don't think they are related it might have fixed, i'm going to merge it so you can check if it still happens with those changes |
In trying to remove all the warnings from the project generator, I noticed that when using ofDirectory::createDirectory recursively it works yet throws a warning that the folder exists. for example, I am trying to create "/temp/test" at the desktop (ie, a nested folder):
gives back (if that folder isn't there)
looking at the desktop, those nested folders are there.
it seems like an issue with the "create_directories" function used internally, since those directories are being generated but it's returning false instead of true.
The text was updated successfully, but these errors were encountered: