dome icon indicating copy to clipboard operation
dome copied to clipboard

FileSystem listDirectories has unexpected entries

Open Deijin27 opened this issue 1 year ago • 2 comments

When you run FileSystem.listDirectories there is two extra entries in the list "." and ".." This seems to be inherent to the win32 FindNextFile function called by tinydir.

It caught me out because I was writing a function to recursively get files from a directory, and I was getting an infinite loop so the dome window never showed but dome was still running.

I'm thinking these should probably be filtered out and not included in the result of FileSystem.listDirectories. What do you think?

Deijin27 avatar Jul 12 '24 21:07 Deijin27

I need to check if this happens on Linux and I'll decide which way the API should go based on that

On Fri, 12 Jul 2024, 22:12 Deijin, @.***> wrote:

When you run FileSystem.listDirectories there is two extra entries in the list "." and ".." This seems to be inherent to the win32 FindNextFile function called by tinydir.

It caught me out because I was writing a function to recursively get files from a directory, and I was getting an infinite loop so the dome window never showed but dome was still running.

I'm thinking these should probably be filtered out and not included in the result of FileSystem.listDirectories. What do you think?

— Reply to this email directly, view it on GitHub https://github.com/domeengine/dome/issues/273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALBBLZCCHWH4O3QPLC5TX3ZMBBFLAVCNFSM6AAAAABKZSZYHGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDMMZVGM4DSNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

avivbeeri avatar Jul 12 '24 21:07 avivbeeri

Just tested on linux and the dots are there too.

The function for this in wren_cli does not have dots. Neither do any apis in other programming languages I know of. I can't think of a situation where you wouldn't need to filter them out to get what you want.

Deijin27 avatar Jul 13 '24 19:07 Deijin27