check file size

Post your questions and help other users.

Moderator: Martin

Post Reply
ahmadmll
Posts: 69
Joined: 06 Jul 2013 15:02

check file size

Post by ahmadmll » 13 Sep 2013 19:32

Hi my friends
I want a flow to check file size on this directory "/mnt/sdcard/a.txt" and when it larger than 17kb does an action.
Please help me...

standalonescript
Posts: 18
Joined: 13 Sep 2013 03:11

Re: check file size

Post by standalonescript » 13 Sep 2013 21:56

It does not appear to be supported. I tried to do eval ("ls /sdcard") but it looks like only AA functions can be eval'd.

There aren't any actions for file size either.

I don't recall seeing that in the list for 1.19 either.

I didn't even find a way to do this with Tasker. I know it can be done with ruboto but that is a little more involved.

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

Re: check file size

Post by Martin » 14 Sep 2013 07:12

Hi,

You can try to execute a shell command like Execute Command: ls -l /mnt/sdcard/a.txt or Execute Command: du /mnt/sdcard/a.txt and then use variable stdout.
The variable will most likely not just contain the size but also the file name so you have to use a script to extract the substring containing the size.

Regards,
Martin

Post Reply