New topic: error on deleting file
<http://forums.realsoftware.com/viewtopic.php?t=45906> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Rivo Post subject: error on deleting filePosted: Wed Nov 14, 2012 5:17 am Joined: Tue Aug 29, 2006 4:04 am Posts: 481 Location: Indonesia Hi, I want to delete the file on my default application folder/Report/14-nov-2012/5.tbl I use this code below, dim file as FolderItem file = getfolderitem("Report").Child(L_Date.text).Child(L_table.text+".tbl") file.delete before it was running, but I dont know why, its doesnt working anymore. I have check the file attribute is okay. I can easily delete manually. any helps.? thanks Regards, Rivo Top amitavak Post subject: Re: error on deleting filePosted: Wed Nov 14, 2012 8:58 am Joined: Mon Jan 02, 2012 1:51 am Posts: 360 Location: India Hi, Did you check the the "file.AbsolutePath" property? Are you getting the correct path? _________________ Amitava Karan Real Studio 2012 Release 1 Windows 7 (32 bit) Mac OS X Version 10.7 Top ktekinay Post subject: Re: error on deleting filePosted: Wed Nov 14, 2012 10:01 am Joined: Mon Feb 05, 2007 5:21 pm Posts: 230 Location: New York, NY Try rewriting your code like this and see what happens: dim file as FolderItem file = getfolderitem("Report").Child(L_Date.text).Child(L_table.text+".tbl") if file <> nil and file.Exists then file.delete else MsgBox "Couldn't find the file to delete." end if _________________ Kem Tekinay MacTechnologies Consulting http://www.mactechnologies.com/ Need to develop, test, and refine regular expressions? Try RegExRX. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
