Click here to Skip to main content
15,915,509 members
Home / Discussions / C#
   

C#

 
Generalproblem in file deletion Pin
Miss Maheshwari22-Feb-08 0:03
Miss Maheshwari22-Feb-08 0:03 
GeneralRe: problem in file deletion Pin
Colin Angus Mackay22-Feb-08 0:17
Colin Angus Mackay22-Feb-08 0:17 
QuestionRe: problem in file deletion Pin
Miss Maheshwari22-Feb-08 0:45
Miss Maheshwari22-Feb-08 0:45 
GeneralRe: problem in file deletion Pin
Giorgi Dalakishvili22-Feb-08 1:06
mentorGiorgi Dalakishvili22-Feb-08 1:06 
QuestionRe: problem in file deletion Pin
Miss Maheshwari22-Feb-08 1:44
Miss Maheshwari22-Feb-08 1:44 
GeneralRe: problem in file deletion Pin
DaveyM6922-Feb-08 1:57
professionalDaveyM6922-Feb-08 1:57 
GeneralRe: problem in file deletion Pin
Xmen Real 22-Feb-08 2:47
professional Xmen Real 22-Feb-08 2:47 
GeneralRe: problem in file deletion Pin
Luc Pattyn22-Feb-08 2:04
sitebuilderLuc Pattyn22-Feb-08 2:04 
Hi,

if you want write or delete access (anything other than read access) to a file
that just got created (by yourself or someone else, does not matter),
chances are you will find the file is being accessed by some other process,
and your access is not granted.

The other process very likely is some server code that is there to assist you
somehow. Candidates are:
- anti-virus software (Norton, McAfee, whatever)
- indexing software (Google Desktop, MS Office, whatever)
The common thing is these packages are looking all the time for new files, so
they can inspect them.

Microsoft is aware of the consequences; Windows Explorer will try rename and
delete attempts up to five times (with one-second interval), and only reports
failure if the action continues to fail for that time.

The solution:
1. either use a different file name
2. or remove all background reader candidates (bad idea)
3. or implement the retry loop as Explorer has it (use a Windows.Forms.Timer
for this)

PS: while debugging and single-stepping, your code runs more slowly and is less
likely to be affected by the above...

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: problem in file deletion Pin
Ravenet22-Feb-08 3:11
Ravenet22-Feb-08 3:11 
GeneralProblem with tabindex settings Pin
Dev Motiramani21-Feb-08 23:24
Dev Motiramani21-Feb-08 23:24 
GeneralRe: Problem with tabindex settings Pin
phannon8621-Feb-08 23:27
professionalphannon8621-Feb-08 23:27 
GeneralRe: Problem with tabindex settings Pin
Dev Motiramani22-Feb-08 0:02
Dev Motiramani22-Feb-08 0:02 
GeneralRe: Problem with tabindex settings Pin
phannon8622-Feb-08 0:13
professionalphannon8622-Feb-08 0:13 
GeneralDowncasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h21-Feb-08 23:02
N a v a n e e t h21-Feb-08 23:02 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Colin Angus Mackay21-Feb-08 23:39
Colin Angus Mackay21-Feb-08 23:39 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h22-Feb-08 3:21
N a v a n e e t h22-Feb-08 3:21 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Roger Alsing21-Feb-08 23:44
Roger Alsing21-Feb-08 23:44 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h22-Feb-08 3:20
N a v a n e e t h22-Feb-08 3:20 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Pete O'Hanlon21-Feb-08 23:57
mvePete O'Hanlon21-Feb-08 23:57 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h22-Feb-08 3:18
N a v a n e e t h22-Feb-08 3:18 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Pete O'Hanlon22-Feb-08 4:28
mvePete O'Hanlon22-Feb-08 4:28 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Guffa22-Feb-08 0:28
Guffa22-Feb-08 0:28 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h22-Feb-08 3:17
N a v a n e e t h22-Feb-08 3:17 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
Mike Dimmick22-Feb-08 1:37
Mike Dimmick22-Feb-08 1:37 
GeneralRe: Downcasting VS Interfaces - Performance perceptive Pin
N a v a n e e t h22-Feb-08 3:16
N a v a n e e t h22-Feb-08 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.