recursive scandir for new files

Post your questions and help other users.

Moderator: Martin

Post Reply
anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

recursive scandir for new files

Post by anuraag » 10 Nov 2018 15:20

When doing a recurive scan for files inside a directory, if that directory contains folder inside then Init Variable File List-include changes only don't work. It gives all files instead of changes only.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: recursive scandir for new files

Post by Desmanto » 10 Nov 2018 16:44

AFAIR, include changes only will list changes if executed the second time. Somehow it store the temporary changes log somewhere. Probably until next automagic start/stop?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: recursive scandir for new files

Post by anuraag » 11 Nov 2018 01:41

I know it will show new file on second run but its not.
I have attachwd flow. Just set path in 1st action and make sure that folder contains atleast one folder inside.
http://automagic4android.com/flow.php?i ... 75521aee4d

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: recursive scandir for new files

Post by Desmanto » 12 Nov 2018 23:15

I got the {file} contains all the files from the folder and subfolders. {dir} is blank (as removed in every iteration).

If you want to list all files within certain folder, you can use a much shorter terminal command.

Code: Select all

du -h -a -d 10 /sdcard/download
This will list all files and folders from /sdcard/download/. Later you can parse/split the path a bit and check if it is a directory. Only add the files to the new list.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: recursive scandir for new files

Post by anuraag » 13 Nov 2018 01:04

Thats really a nice cmd and saves time. Thanks

Post Reply