Home > Community > Forums > PCB SKILL > deleteFile function throws error if file is opened

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 deleteFile function throws error if file is opened 

Last post Mon, Apr 8 2013 10:33 PM by Pawandeep. 3 replies.
Started by Pawandeep 05 Apr 2013 01:07 AM. Topic has 3 replies and 709 views
Page 1 of 1 (4 items)
Sort Posts:
  • Fri, Apr 5 2013 1:07 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Fri, Oct 14 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    deleteFile function throws error if file is opened Reply
    Hi, Is there any way to check if a txt file is opened by a user or not before using deleteFile() function?I want to delete a file but if the user has already opened a file then deleteFile() functions shows error and the program halts. Regards,

    Pawan
    Filed under:
    • Post Points: 35
  • Fri, Apr 5 2013 4:47 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: deleteFile function throws error if file is opened Reply

    Hi Pawan

    Use the command isWritable to check if you can write to the file, if that's the case then it is not readonly :-)

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
  • Fri, Apr 5 2013 5:06 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 298
    • Points 4,735
    Re: deleteFile function throws error if file is opened Reply

     try: errset( deleteFIle( <filename> ))

    • Post Points: 20
  • Mon, Apr 8 2013 10:33 PM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Fri, Oct 14 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    Re: deleteFile function throws error if file is opened Reply
    Thanks for your suggestions. Regards,

    Pawan

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Pawandeep at 05 Apr 2013 01:07 AM. Topic has 3 replies.