Summary: | Dir(<name existing file>) returns empty string | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Cor Nouws <cno> |
Component: | BASIC | Assignee: | Noel Power <nopower> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fyvaao |
Priority: | high | ||
Version: | 3.4.0 Beta3 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 35673 |
Description
Cor Nouws
2011-05-06 02:42:54 UTC
This code seems to work in LibO3.4beta3: Sub ShowFiles Dim NextFile As String Dim AllFiles As String AllFiles = "" NextFile = Dir("/home/", 16) While NextFile <> "" AllFiles = AllFiles & Chr(13) & NextFile NextFile = Dir Wend MsgBox AllFiles End Sub (Replace /home/ with C:\ on Windows) I.e., the Dir() function applied to a filename returns empty string now. Maybe this should be so? BTW, in order to list files, 0 should be used in Dir function as the second argument. * 0 : returns normal files * 16 : sub-directories (see http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Files_and_Directories_%28Runtime_Library%29) Dir(filename) always just worked. In 340beta3 it does not. Adding the argument 0 does not make any difference: still returns an empty string. (In reply to comment #3) > Dir(filename) always just worked. In 340beta3 it does not. > > Adding the argument 0 does not make any difference: still returns an empty > string. afaics it's a bug, trying to find out what changed At a later moment, I was running gdb when using Dir() FWIW, the output: Program received signal SIGPIPE, Broken pipe. 0xb7fe1424 in __kernel_vsyscall () fixed on libreoffice-3.4 http://cgit.freedesktop.org/libreoffice/libs-core/commit/?h=libreoffice-3-4&id=4e019509ca8a17a81f71141157ed240ed827fccb (In reply to comment #5) > At a later moment, I was running gdb when using Dir() > > FWIW, the output: > Program received signal SIGPIPE, Broken pipe. > 0xb7fe1424 in __kernel_vsyscall () I would guess unrelated :-) thanks Noël ! |