View Issue Details

IDProjectCategoryView StatusLast Update
0000684LDMud 3.3Efunspublic2009-10-04 10:17
Reporterzesstra Assigned Tozesstra  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Target Version3.3.720Fixed in Version3.3.719 
Summary0000684: get_dir(): listing directory contents does not work according to documentation
DescriptionThe get_dir() efun has a few inconsistencies.
One is: get_dir("/",...) returns the _contents_ of the root directory. get_dir("/some/other/path/",...) will not return the contents, but the directory "/some/other/path" itself.
Additionally, the man page states:
      To query the content of a directory, use the directory name with a
      trailing '/' or '/.', for example get_dir("/path/."). Use the
      directory name as it is to get information about the directory itself.
But neither a trailing '/' nor a trailing '/.' does work, because they are stripped off by get_dir. You have to use "/some/other/path/*" for path not being the root dir of the mudlib.

So, unfortunately, changing the behaviour to be a) consistent and b) according to documentation will probably lead to compatibility problems, as Gnomi already pointed out in a private discussion.

So, I want to record the issue here and document the decision: adapt the behaviour to the documentation or change the documentation to the inconsistent behaviour?
TagsNo tags attached.

Activities

fufu

2009-10-02 15:01

manager   ~0001430

I believe the efun works as described, but with a twist: The path being used is the one returned from valid_read() in the master. That fact should be documented.

(In our mudlibs, valid_read() does path normalization, 'breaking' get_dir)

zesstra

2009-10-03 18:33

administrator   ~0001441

Very good point, that seems to be the reason. *argl*
For "/" it works, because that is then stripped to "" and "" is converted to "." which is interpretated as the mudlib root directory itself.
I guess, I have to fix some mudlib, there is no real reason not to conserve the trailing /. ;-)
But I agree, that the documentation has to be improved.

zesstra

2009-10-04 10:17

administrator   ~0001446

I added a note about the path normalization to the manpage in r2752 and r2753.

Issue History

Date Modified Username Field Change
2009-10-01 18:33 zesstra New Issue
2009-10-02 15:01 fufu Note Added: 0001430
2009-10-03 18:33 zesstra Note Added: 0001441
2009-10-03 18:33 zesstra Assigned To => zesstra
2009-10-03 18:33 zesstra Status new => assigned
2009-10-04 10:17 zesstra Note Added: 0001446
2009-10-04 10:17 zesstra Status assigned => resolved
2009-10-04 10:17 zesstra Fixed in Version => 3.3.719
2009-10-04 10:17 zesstra Resolution open => fixed