In Basic, simply use the function Dir for an existing file
> Returns empty string.
Expected output: file name
This code seems to work in LibO3.4beta3:
Dim NextFile As String
Dim AllFiles As String
AllFiles = ""
NextFile = Dir("/home/", 16)
While NextFile <> ""
AllFiles = AllFiles & Chr(13) & NextFile
NextFile = Dir
(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
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
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
(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 !