how to delete file

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
lvy
Posts: 26
Joined: Tue Dec 14, 2004 8:22 pm
Location: Shanghai, China

how to delete file

Post by lvy »

Hello, everyone!!

How to delete the specified file in the specified directory in Opensees when the program work? I used the command "file delete E:/lvy/output/a.txt", but it doesn't work. The error is given, "permission denied". But after I end the programe, the command works well.


Thank you,

With regards,

Liang Zhiyao
lvy
Posts: 26
Joined: Tue Dec 14, 2004 8:22 pm
Location: Shanghai, China

Post by lvy »

I got the answer, the code is as follow.

Code: Select all

remove recorders
for {set j 1} {$j<11} {incr j 1} {
file delete -force E:/lvy/OpenSEES/final/modevector$j.out 
}
berktaftali
Posts: 68
Joined: Fri Jul 02, 2004 6:10 am
Location: Computers and Structures, Inc.

Post by berktaftali »

Try

Code: Select all

file delete -force "E:\\lvy\\OpenSEES\\final\\modevector$j.out"
Berk Taftali
Georgia Institute of Technology
Ph.D. Candidate, Structural Engineering, Mechanics, and Materials
School of Civil and Environmental Engineering
Atlanta, GA 30332 USA
Email: gte994y@mail.gatech.edu
lvy
Posts: 26
Joined: Tue Dec 14, 2004 8:22 pm
Location: Shanghai, China

Post by lvy »

The command that berktaftali give me is right. When the program is running, we must stop recoder object that is writing data to the file. So "remove recorder" is necessary.
Post Reply