PC Review


Reply
Thread Tools Rate Thread

Create / remove directory

 
 
=?Utf-8?B?U3VzaGlTZWFu?=
Guest
Posts: n/a
 
      9th Oct 2007
Hello. I have problem with create and then remove directory on my site.
It works like this. My page
1) create directory
Directory.CreateDirectory(DirectoryPath);
2) put some files
3) Remove directory
Directory.Delete(DirectoryPath, true);

And I have problem here. For some strange reasons this directory because
read only and locked. I can't even open this until reopen my visial studio.
Why it happend? How I can create directory with full access and then remove
it with all files and subfolders inside?
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      9th Oct 2007
Only when using VS.NET ? Also if the file is server by ASP.NET it is lokced
by default for a short period of time. Soa ccessing the site from a web
client could prevent deleting it immedately after.

Not sure what you are doing with those directories/files but my personal
preference would be to avoid this or perhaps to serve them direcdtly from an
aspx page (in whihc case IIS won't lock them).

Also double check of course that you are properly closing those file...

--
Patrice


"SushiSean" <(E-Mail Removed)> a écrit dans le message de
news: 562889C8-7774-4BBA-B56B-(E-Mail Removed)...
> Hello. I have problem with create and then remove directory on my site.
> It works like this. My page
> 1) create directory
> Directory.CreateDirectory(DirectoryPath);
> 2) put some files
> 3) Remove directory
> Directory.Delete(DirectoryPath, true);
>
> And I have problem here. For some strange reasons this directory because
> read only and locked. I can't even open this until reopen my visial
> studio.
> Why it happend? How I can create directory with full access and then
> remove
> it with all files and subfolders inside?



 
Reply With Quote
 
=?Utf-8?B?U3VzaGlTZWFu?=
Guest
Posts: n/a
 
      9th Oct 2007
Thanks, what about derectory security?
I mean in function Directory.Create(DirName, Security)
exist Security param. How set up this to make dir with full access?

"Patrice" wrote:

> Only when using VS.NET ? Also if the file is server by ASP.NET it is lokced
> by default for a short period of time. Soa ccessing the site from a web
> client could prevent deleting it immedately after.
>
> Not sure what you are doing with those directories/files but my personal
> preference would be to avoid this or perhaps to serve them direcdtly from an
> aspx page (in whihc case IIS won't lock them).
>
> Also double check of course that you are properly closing those file...
>
> --
> Patrice


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MkDir won't create a directory and sub directory at the same time pubdude2003 via AccessMonster.com Microsoft Access VBA Modules 3 22nd Dec 2006 03:26 PM
Web Setup project - create virtual directory & point to another location in directory structure kplkumar@gmail.com Microsoft C# .NET 0 12th Apr 2006 06:26 PM
Create Directory in a shared newtok directory Paul Bromley Microsoft VB .NET 2 2nd Dec 2004 12:00 AM
Remove Directory from Command line, Access is denied, The directory is not empty Dennis W. Bulgrien Windows XP General 1 9th Jul 2004 02:07 AM
vcdeploy : error VCD0035: Failed to create the file system directory for the virtual directory. Access is denied. Dominic Microsoft VC .NET 0 17th Jun 2004 01:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:36 AM.