//Delete file if it exists already
if ( (fn = java.io.File("C:\\Active_Users.CSV")).exists() == false) {
//File already does not exist
task.logmsg("Active User List does not already exist.");
} else {
//Delete the file
task.logmsg("Deleting Active_Users.CSV...");
task.logmsg(fn.delete());
}
And here is the message I get from TDI:
[9:37:49 AM EST] com.ibm.jscript.parser.ParseException: Encountered
"delete" at line 13, column 32.
Was expecting:
<IDENTIFIER> ...
Here's the JavaDoc I'm trying to go off of:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#delete()
If I use another function on that page besides delete, it seems to
work fine. I used renameTo, and as long as I provide a valid filename
to rename to, it completes successfully. Unfortunately I'm going for
a delete and not a rename.
Has anyone been able to delete files through Java within TDI using
this or another method?
Thanks!
-Kevin McCullough
fn["delete()"]()
I think that's the syntax (holiday memory loss).
As Bill mentioned, there are a number of convenience
functions in the "system" object (class UserFunctions).
-Eddie