Jump to content

[WONTFIX] Dir::open() bug


photo

Recommended Posts

Posted

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, "/") + "/";
Posted

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)

  • 2 weeks later...
Posted

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:

Posted

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:

×
×
  • Create New...