- 0
[VB.NET] Delete File in process
Asked by
James Rose,
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By excalpius · Posted
I suspect that this was also due to a nice juicy bribe from the Chinese. They know how to pay to play... -
By Steven P. · Posted
You can get RAID if it is connected to a TerraMaster NAS (TOS 6). In that case this device is interesting if you want to expand your existing TerraMaster NAS setup. For example you could get a cheap 2- or 4-bay HDD model (with at least USB 3.2 10Gbps port), and then add this for a low power storage expansion. -
By LoneWolfSL · Posted
Microsoft announces multi-year partnership with AMD for future of Xbox consoles and hardware by Pulasthi Ariyasinghe The Xbox Games Showcase was earlier this month with its own hardware announcement, but Microsoft had kept a major partnership under wraps for now. Today, it revealed that it has established a "strategic multi-year partnership with AMD" to develop its next-generation Xbox consoles and other devices. In a video uploaded to the Xbox social channels, Xbox president Sarah Bond announced the partnership with AMD. Remember that Microsoft's Xbox Series X|S consoles and the previous Xbox One lineup already tout AMD silicon inside, so the continued partnership isn't a big surprise. "Together with AMD we're advancing the state of art in gaming silicon to deliver the next generation of graphics innovation to unlock a deeper level of visual quality and immersive gameplay and player experiences enhanced with the power of AI, all while maintaining compatibility with your existing library of Xbox games," said Bond in the video promoting the partnership. The two Xbox Ally Windows gaming handhelds that were announced earlier this month also come with AMD internals, offering handheld gaming experiences with a unique, lightweight version of bloat-free Windows 11. What was also interesting were the few hints that were dropped today regarding the focus of the Xbox brand going forward. "This is all about building you a gaming platform that's always with you, so you can play the games you want across devices anywhere you want, delivering you an Xbox experience not locked to a single store or tied to one device," added Bond. It was also confirmed that the next generation of Xbox devices will continue to offer backward compatibility, letting players keep their existing libraries when moving forward. Finishing off the video, Bond confirmed that the Xbox team is now working on Windows to make it the "number one platform for gaming," perhaps alluding to moving away from being focused on home consoles. -
By excalpius · Posted
Kudos to the happy talented people who created that happy trailer. PS It's gorgeous! -
By Draidus12 · Posted
Maybe the site will get out of dabbing into Identity Politics.
-
-
Recent Achievements
-
Cole Multipass earned a badge
Reacting Well
-
JLP earned a badge
Reacting Well
-
Rhydderch earned a badge
Week One Done
-
dismuter went up a rank
Experienced
-
mevinyavin earned a badge
One Month Later
-
-
Popular Contributors
-
Tell a friend
Question
James Rose
Ok gang,
I've got an interesting problem. I have a .net 2.0 app that goes off to a server to get a file and unzip it locally. This process is threaded. It's possible that during the first run through the process the end-user may need to stop the original process and go get a different file.
So, I abort the initial thread and start over. The issue? (Glad you asked) Seems that one or more files (the zip and possibly files from within the zip file, depending on how far along the initial process is) will not delete (File.Delete(path) as these files are in use my another process.
Exact error:
Description: The process cannot access the file 'c:\TestExtract\75872-01-1.ado' because it is being used by another process.
The code that is pulling the file from the zip is here:
--- BEGIN CODE CHUNK --------
If (sFileName <> String.Empty) Then
Dim StreamWriter As FileStream = File.Create(sDirectory & theEntry.Name)
Dim Size As Integer = 2048
Dim data(2048) As Byte
While (True)
Size = stmZipFile.Read(data, 0, data.Length)
If (Size > 0) Then
StreamWriter.Write(data, 0, Size)
Else
Exit While
End If
End While
StreamWriter.Close()
End If
--- END OF CODE CHUNK --------
Ive tried watching for the thread's abort request in that loop, but it never gets it. So I can't close the stream (arg)
I've looked to see if I can get the handle of the process that is using the file so I can kill the process and then the file... but so far no luck. I'm heading home now, but I'll check back in a few hours (it's 5pm est)
Thanks for any ideas.
Link to comment
https://www.neowin.net/forum/topic/578013-vbnet-delete-file-in-process/Share on other sites
4 answers to this question
Recommended Posts