ulf.schroeter Posted October 16, 2013 Posted October 16, 2013 Problem When calling Dir::open( string dirname ) with dirname string NOT ending with '/' character (e..g 'C:/dir' instead of 'C:/dir/') the represented directory content is not correct e.g. Dir.getNumFiles()/getNumDirs() give unexpected results. Solution Dir:.open() implementation should internally automatically ensure required dirname format by appending '/' when not specified by caller. Temporay Workaround dirname = trim(dirname, "/") + "/";
ulf.schroeter Posted October 16, 2013 Author Posted October 16, 2013 In addition the documentation of the return value of int Dir::open( string dirname ) is wrong. It's not a 'Directory descriptor', but a boolean 0/1 success indicator. Also for the dirname parameter it is unclear if a relative or an absolute path is required (e.g similar to Filesystem::is_dir() documentation)
silent Posted October 28, 2013 Posted October 28, 2013 Hi Ulf, Dir.getNumFiles()/getNumDirs() give unexpected results. Thanks for the report. I've sent this information to the developers. In addition the documentation of the return value of int Dir::open( string dirname ) is wrong. Documentation on Dir:: section will be fixed ASAP. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
silent Posted October 28, 2013 Posted October 28, 2013 Hi Ulf, I'm afraid this issue will not be fixed. This is a system function wrapper. We will add note into our documentation about the '/' char ath the end of the string. Sorry for the inconvenience. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts