Closed decuant closed 4 years ago
@decuant, both Exists
and GetAllFiles
are static functions, so you'd need to call them as wxDir.Exists()
or dir.Exists()
(assuming dir = wx.wxDir()
). Notice .
instead of :
, as the static functions are not methods, so they don't take the object as the first parameter.
Also, for GetAllFiles
, it expects the path, the filespec, and the flags, so in your case the call should be dir.GetAllFiles(inPathname, "*.json", wx.wxDIR_FILES)
. The directory referenced by dir
doesn't need to be open for these methods to work, as they take the directory name as the parameter.
- wxDir::GetAllFiles(string [, string, number]) - static
Notice that it references the fact that the function is static in the description, although it's easy to miss.
I'm closing this, but let me know if this still doesn't work for you.
Hello,
I'm using wxDir and I'm getting this strange error with Exists and GetAllFiles.
I reverted my source code to use Open instead of Exists and GetFirst/GetNext instead of GetAllFiles, but wanted to point the issue out.
Below is code failing (actually lines commented out), if can be of help:
Thank you
Antonio