Deleting a file from the client

(imported topic written by wustldz)

I’m attempting to delete a file from a client using a task action script.

I’ve tried the following without success. Any pointers would be appreciated.

delete "{pathname of client folder of "actionsite" & "__Download\dan.txt"}"
 
delete "{pathname of client folder of current site & "__Download\dan.txt"}"
 
delete __Download\dan.txt

(imported comment written by SystemAdmin)

does the file currently have a lock on it?

Is there a reason this file must “die” now instead of letting the client clean up the files in the normal processing? The client will remove all folders in the __Download directory automatically, likely on the next gather or next download action performed in that site.

(imported comment written by SystemAdmin)

Remember the result of the pathname relevance will give you a path without the trailing ‘’ so you will need to append that in if you are assembling a string.

That being said, the last one (delete __Download\dan.txt) should work fine if the file was downloaded by the action you are running as the relative directory is the site directory.

Remember the file won’t be there from any previous action as the system clears the __Download directory as an action starts to run

(imported comment written by SystemAdmin)

The only thing I could think of was, were you running on Windows? If you aren’t remember the delimiter is ‘/’ (which Windows is also nice enough to interpret correctly)

(imported comment written by wustldz)

Thanks to all for the replies. I was able to get (delete __Download\dan.txt) to work.