Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  Cannot delete file using FileSystemUtils.DeleteFile()
Previous Previous
 
Next Next
New Post 6/24/2008 9:35 AM
User is offline mmourouti
26 posts
10th Ranked


Cannot delete file using FileSystemUtils.DeleteFile() 

Hello,

i am trying to delete files which are located inside a folder.

I use FileSystemUtils.GetFilesByFolder() to get the files of the given folder and then i attempt to delete the file using FileSystemUtils.DeleteFile().

Most of the times, it does not allow the deletion and get the following error message:

"The process cannot access the file '....' because it is being used by another process."

Does the FileSystemUtils.GetFilesByFolder() somehow lock that folder or files?

 

I appreciate any comment you can make on this.

Thanks,

M. Mourouti

 
New Post 6/26/2008 2:02 AM
User is offline mmourouti
26 posts
10th Ranked


Re: Cannot delete file using FileSystemUtils.DeleteFile() 

Hello again,

i think it's not the methods i am using that are causing the problem.

I think it's the Bitmap object which is not releasing the resources quick enough.

Thanks,

M. Mourouti

 
New Post 6/30/2008 2:43 AM
User is offline mmourouti
26 posts
10th Ranked


Re: Cannot delete file using FileSystemUtils.DeleteFile() 

Hello everyone,

after spending a lot of time on this, i concluded to my initial thoughts, that is, FileSystemUtils.GetFolder() locks the files in that folder and i cannot delete them after accessing them though that method. I have verified this in many ways, stepped through the code and as soon as i get the files using that method, they are locked.

Is that a known issue? Is there a workaround for this?

I thought that FileSystemUtils.GetFolder() would just work as simple as :

' Get folder.
Dim folder As System.IO.DirectoryInfo = ...

' Get files for that folder.
Dim Files() As System.IO.FileInfo = folder.GetFiles()

The above code works fine without locking the files .. but it would be great if i could user DotNetNuke FolderInfo and FileInfo objects instead.

I appreciate any comments you can make on this.

Thanks,

M. Mourouti

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Chat About It!  Cannot delete file using FileSystemUtils.DeleteFile()
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Vekkin Solutions
Vekkin Solutions provides complete website solutions and custom module development to churches and small businesses.
www.vekkin.com
Powered by Adcuent®.Com
Adcuent® Consulting & Technology offers custom development web applications and hosting projects under the brand of Powered by Adcuent®.Com
www.adcuent.com
Easily Build DNN Solutions with XMod
XMod makes it easy to build news articles, house listings, custom feedback forms, product reviews and much more - without programming
www.DNNDev.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP