Inventor Engineer-to-Order

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

How to delete a file

78 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: 262
Registered: ‎07-13-2009
Message 2 of 2 (76 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"
************************************************************************************

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube