getFileList(dir) includes "Thumbs.db" in Window XP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

getFileList(dir) includes "Thumbs.db" in Window XP

Lim Soon Yew
Dear All,

When I am running the built-in macro function getFileList(dir) in Window XP, it includes the "Thumbs.db" file generated by Window XP. But when I run the same macro in Window 7, it gives me the right number of files and does not include any "Thumbs.db" file.

I am using Fiji (1.45k). Does any of you running macros in Window XP gets the same problem? Thanks for the help.

Best Regards,
John
Reply | Threaded
Open this post in threaded view
|

Re: getFileList(dir) includes "Thumbs.db" in Window XP

dscho
Hi Soon Yew (hope I got that correctly),

On Thu, 14 Jul 2011, Lim Soon Yew wrote:

> When I am running the built-in macro function getFileList(dir) in Window
> XP, it includes the "Thumbs.db" file generated by Window XP. But when I
> run the same macro in Window 7, it gives me the right number of files
> and does not include any "Thumbs.db" file.

Windows 7 probably marks the Thumbs.db file as hidden by default, that is
my guess. I am working around issues like these by doing something like

        list = getFileList(dir);
        for (i = 0; i < list.length; i++)
                if (list[i] != "Thumbs.db")
                        ...

Quite often, I already know the desired file extension, in which case I
can use something like "if (endsWith(list[i], ".png"))" instead, which is
even more specific.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: getFileList(dir) includes "Thumbs.db" in Window XP

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Lim Soon Yew
On Jul 14, 2011, at 9:24 AM, Lim Soon Yew wrote:

> Dear All,
>
> When I am running the built-in macro function getFileList(dir) in Window XP, it includes the "Thumbs.db" file generated by Window XP. But when I run the same macro in Window 7, it gives me the right number of files and does not include any "Thumbs.db" file.
>
> I am using Fiji (1.45k). Does any of you running macros in Window XP gets the same problem? Thanks for the help.

The getFileList() macro function in the ImageJ 1.45l daily build ignores "Thumbs.db" files.

-wayne