Problem description: It appears that if the Dir() function in Basic hits any errors in accessing the directory, the results returned can not be relied upon. The function does not generate any errors back to the program and does not alert the user in any way. If there are any file names still in the queue from a prior call to the Dir() function, it will return those names. If not, it will return what appears as an empty directory. This occurs in both Windows and Linux environments (see “Table 6: Result summary for Linux, Dir() function“ and “Table 9: Result summary for Windows, Dir() function“ for screen shots, and 3.2.1, “Messages and debug output“ for additional discussion). Steps to reproduce: 1. Make call to Dir() for any path that would cause an error (e.g. /tmp/NoSuchPath) 2. Dir() will return empty string or phantom file names depending on prior calls to Dir() that succeeded. 3. .... Current behavior: Returns phantom file names in some cases. Expected behavior: Return no file names if directory not readable or accessible. Generating an error would be nice, but might break too many existing macros. I will upload a document with screen-shots and additional info./ Operating System: All Version: 4.2.3.3 release
Created attachment 98562 [details] Screen shots and additional notes to reproduce problem
I add LibO BASIC expert to CC list.
Hi Ewald, (In reply to comment #0) > 1. Make call to Dir() for any path that would cause an error (e.g. > /tmp/NoSuchPath) > 2. Dir() will return empty string or phantom file names depending on prior > calls to Dir() that succeeded. Indeed, this simple test shows it Sub DirTst msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/") msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") End Sub Results > empty > name1 > name2 Do you know if this worked different before? Cheers, Cor
(In reply to comment #3) > Hi Ewald, > > (In reply to comment #0) > > > 1. Make call to Dir() for any path that would cause an error (e.g. > > /tmp/NoSuchPath) > > 2. Dir() will return empty string or phantom file names depending on prior > > calls to Dir() that succeeded. > > Indeed, this simple test shows it > > Sub DirTst > > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/") > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") > > End Sub > > Results > > empty > > name1 > > name2 > > Do you know if this worked different before? > Cheers, > Cor I do not know if this worked differently before. I am relatively new to LibreOffice and can only attest to behavior in version 4.2 and later; this behavior is present in all of these versions. Sorry I can not be of more help with the history.
On pc Debian x86-64 with LO Debian package 5.0.2.2, I don't reproduce this. (I got only empty message). Any update for you with recent LO version?
Dear Bug Submitter, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team Sun, 11 Sep 2016 21:43:24 +0200
Dear Bug Submitter, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-20161010
(In reply to Cor Nouws from comment #3) > Indeed, this simple test shows it > > Sub DirTst > > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/") > msgbox dir("/home/cono/Documenten/DATA/TDF/Marketing/FOO/") > > End Sub > > Results > > empty > > name1 > > name2 This now works fine in daily 20161009 > set as WorksForMe