[Gambas-user] How do I fetch a list of files?
Benoit Minisini
gambas at ...1...
Tue Mar 1 15:01:45 CET 2005
On Tuesday 01 March 2005 14:43, Oliver Stieber wrote:
> --- Eldon Eller <eeller at ...826...> wrote:
> > Yet another dumb question (YADQ): I am writing a
> > gambas app where I want
> > the user to select from a list of files (not via a
> > dialog). So I need a
> > way to fetch the file names from a specified
> > directory. How do I do that?
>
> dir,
> but it seems broken for UTF8 filenames.
> you can use something like...
>
> DIM Directory AS String
> DIM Files AS String[]
> DIM file AS String
> Directory = "/home/foo"
> Files = Dir(Directory, "*")
> print Files.count
> FOR EACH file IN Files
>
> NEXT
>
What do you mean exactly by "it seems broken for UTF-8 filenames" ?
Dir() returns all file names in UTF-8 format. But not OPEN - This will change
in the next version, where everything should be UTF-8.
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list