Your code says to delete the file if it does *not* exist. Which really
makes no sense, since if it doesn't exist, there is nothing to delete.
Sounds like you never actually stepped into this code. Take the '!' out of
the if statement.
> When the following code is execute and the file already exists, the file is
> not actually deleted (in file properties - created date does not change) -
[quoted text clipped - 18 lines]
> sw.Flush();
> }
Salman Zari Ghanvi - 03 Dec 2004 20:43 GMT
You are right ...!!!!!
Looks like i need to take a break :)
Thanks.
> Your code says to delete the file if it does *not* exist. Which really
> makes no sense, since if it doesn't exist, there is nothing to delete.
[quoted text clipped - 27 lines]
>> sw.Flush();
>> }
Salman Zari Ghanvi - 03 Dec 2004 20:51 GMT
Actually, I found that my actual code didnt had that (!)...
I ran this through debug mode (step by step) and saw the file getting
disappear. But on the creation step, I see the same behaviour: the file is
created with the old date - while the accessed and modified are current.
Can anyone try to reproduce it? (after correct my original posted code).
Thanks.
> Your code says to delete the file if it does *not* exist. Which really
> makes no sense, since if it doesn't exist, there is nothing to delete.
[quoted text clipped - 27 lines]
>> sw.Flush();
>> }
Found the solution:
Its an OS 'feature' called tunneling. mskb:12190 (file system tunneling
capabilities).
Problem was fixed after making the thread sleep for 15 seconds (default
value - can be changed thru registry) b/w delete and recreate.
> When the following code is execute and the file already exists, the file
> is not actually deleted (in file properties - created date does not
[quoted text clipped - 18 lines]
> sw.Flush();
> }
Hi Salman
I have got some clue on deleting a file that does not exist. Unfortunately, I think its only possible using Java, not sure about .NET
If you wanna know, then in that case I will need to meet you in person as I can demonstrate this only on my laptop (not on any other machine)
I am coming to MDW, IL on Jan 9 - 10th. Let me know if we can meet.
c u .. reply me at
makcalif **at** yahhh0000 dot com