"init variable file list" contains directories?

Post your questions and help other users.

Moderator: Martin

Post Reply
dewalist
Posts: 4
Joined: 31 Aug 2015 13:11

"init variable file list" contains directories?

Post by dewalist » 29 Sep 2015 04:51

Hi all.

I made a quick-and-dirty wallpaper changer using two flows - one to set the files to a variable, the other to set the wallpaper.

However, at least a few times per day I get an error: "open failed: EISDIR (Is a directory)". Is the "init variable file list" function including directories when it should only contain files? Or is there some other issue? The only thing I can think of to get around this is to script an if condition to capture that error...

Thanks!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: "init variable file list" contains directories?

Post by Martin » 29 Sep 2015 13:11

Hi,

Yes, the list also contains directories. You could use a pattern like /storage/emulated/0/*.jpg to limit the list to jpg files or /storage/emulated/0/*.jpg,/storage/emulated/0/*.png to list different types of images.

Regards,
Martin

dewalist
Posts: 4
Joined: 31 Aug 2015 13:11

Re: "init variable file list" contains directories?

Post by dewalist » 29 Sep 2015 20:22

Ahh, great suggestion, and a quick response - thanks Martin!

Post Reply