Inventor Engineer-to-Order

Inventor Engineer-to-Order

Reply
Contributor
santosh-kul
Posts: 18
Registered: ‎07-21-2011
Message 1 of 2 (104 Views)

How to delete a file

104 Views, 1 Replies
08-31-2012 07:00 AM

Hi,

 

I want to delete the already created log file.

 

Below is the code I am using for writing the log file.

 

Dim

LogFile AsUser = openFile(ProjectLocation() + "\Output\" + "log.txt",:WriteAppend)

Dim a AsAny = write (ErrTxt,LogFile)

Return closeFile (LogFile)

 

Thanks,

Santosh

Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 2 of 2 (102 Views)

Re: How to delete a file

08-31-2012 07:52 AM in reply to: santosh-kul

After the file is closed, the following will delete it.

 

system.io.file.delete(ProjectLocation() + "\Output\" + "log.txt")

 

Thanks,

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.