how to delete trajectory file

Hi MS Usear
I wrote the command for dynamic run as follows:


1. for (my \$yPos=0;\$yPos<=301; \$yPos) {

2. my \$results =Modules->Forcite->Dynamics->Run(\$doc);

and to delete the trajectory file I wrote:

3. my \$trajectory = \$Documents{"filename.xtd"}->Trajectory;

4. \$trajectory->Delete;
but the .xtd file does delete. I tried by using "unlink" command, it doesnot delete
Can any one please give me some idea how to delete a file?
Thanks in advance
Laxmi