FileTools : Some tools to work with files

@vknow360 Hey i want to grab every cache folder size of /android/data/Everyfolder

And put the size into a label. I am not able to do this i didn’t do anything before because I can’t know how to grab plz help me .
:pray:

Kindly elaborate more.

See like i want all cache folders size plus (+) in one label okay ! But i am able to grab only one folder size but i want all folder but only cache folder size .

Like these are all folders in android/data/

And i want only specific size of cache folder of all folder in one label.

Hi
Maybe this can help you:

  • get list of folders from /Android/data folder
  • for each folder check if path/cache/ exists or not
  • if it exists then add its size to a variable
  • when loop ends set label’s text to variable’s value
1 Like

I will try and post here for help

I really want that how to do this can u share me blocks :pleading_face:

Use math block.

@vknow360 in which format the size return
Means in kb or in mb or in bytes or bits.

It returns the file size in bytes.

i follow your steps but got only 1 app cache size everytime it’s give only youtube cache size
what to do next when i put loop in each item block it’s give same things (only youtube cache size ).

result i got

268.3028 mb is the size of YouTube cache folder size

Initialize a local variable.
Add size to the variable.
After loop set label’s text to variable’s value.

1 Like

Thanks for the help but is due to because i divide in loop, i think this is because it doesn’t show appropriate results

No.Since YouTube’s ASD is at last index, loop will run setting cache folder size and stop at YouTube’s cache folder size.

but i didn’t change my variable to local variable , i’m just remove divide block from loop and boom it’s worked sucessfully.
And i want to say thanks to you for making this beautifull extension , am going to make a cleaner app .

Sorry I did not see your previous post carefully.

Welcome :heart_eyes:

1 Like

A suggestion: you could add a new block get filename from file path

1 Like

But there’s a component is in builder already

Copying a file from the assets to the ASD does not work in AI2.
TaifunFile ext. works: App Inventor Extensions: File | Pura Vida Apps

In companion or apk?

Neither of them works.