Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Tasker- Deleting files

Options
  • 26-05-2014 10:17pm
    #1
    Closed Accounts Posts: 4,234 ✭✭✭


    As the title says I'm looking to delete the contents of a folder on my sd card on a daily basis using Tasker. I've had a look around the net but I'm still no wiser. Anybody here now a simple way of going about this? Thanks.


Comments

  • Closed Accounts Posts: 5,734 ✭✭✭J_E


    Would a script do it? You'd have to be rooted of course.

    I'm thinking something along the lines of 'rm [directory]/*.jpg' , *.jpg being all the images in the folder, or whatever format you use.

    Basic Shell Commands


  • Closed Accounts Posts: 4,234 ✭✭✭Fresh Pots


    Cydoniac wrote: »
    Would a script do it? You'd have to be rooted of course.

    I'm thinking something along the lines of 'rm [directory]/*.jpg' , *.jpg being all the images in the folder, or whatever format you use.

    Basic Shell Commands

    Tried that and a few variations. No joy. Back to the drawing board!


  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    I have a feeling Android is like Linux and it takes a little more effort to delete a non-empty folder. I have a task where I list the files in a folder which gives me a variable (array) and then run a for loop through those elements to delete each file. You may require root depending where the files are and who owns them. Both the 'List files 'and delete file actions are inbuilt Tasker ones - no script required.


  • Closed Accounts Posts: 4,234 ✭✭✭Fresh Pots


    Bluefrog wrote: »
    I have a feeling Android is like Linux and it takes a little more effort to delete a non-empty folder. I have a task where I list the files in a folder which gives me a variable (array) and then run a for loop through those elements to delete each file. You may require root depending where the files are and who owns them. Both the 'List files 'and delete file actions are inbuilt Tasker ones - no script required.

    Would you be able to post up a screenshot of the delete files part. Can't seem to get it sorry!


  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    If you do a list files action you get back an array - say you call it %files(). You can the do a for loop to loop through that array:
    for %file in %files() and then run the delete action on %file for each run of the loop.


  • Advertisement
Advertisement