I have a file copying program and I have a custom class that utilizes a System.IO.FileSteam to copy a file to a destination computer. For the most part it works quite well. However I use it to copy to many remote locations. Some of them have subpar network connections. Every so often I'll get a server that has a unreliable network connection and it will momentarily drop off the network for a few seconds. When this happens my FileStream breaks with the exception "The specified network name is no longer available.". This is expected.
However the problem is after the program has waited 60 seconds it will retry the transfer. The problem now is it can't even start because I get the error "The process cannot access the file '\\MyServer\c$\MyFile.zip' because it is being used by another process". I'll continue to get this error indefinitely until I close the program and restart the transfer, then it is able to transfer once again.
It would appear that my source server still has a file handle open when this happens that's preventing the transfer again and closing the program releases it. I would like to programically release the handle so I can restart the transfer automatically.
Here's what I've tried so far:
When the file transfer is started, I grab the FileSteam.SafeFileHandle to a variable. When I get the above error, I've tried accessing SafeFileHandle.SetHandleAsInvalid(), SafeFileHandle.DangerousRelease() and SafeFileHandle.Close(), but I'll still get the file in use error when I retry.
From what I understand, RAID 1 makes a copy of one disk.
How does it do this?
If something happened to one drive, could I take the other one out, plug it into a PC and use it like a normal disk?
I have two hard drives that have the same information on - a bit of protection if one drive fails. But I've just been manually copying the data twice.
Microsoft SharePoint gets Modern Page Templates to speed up page creation by Paul Hill
SharePoint, Microsoft’s enterprise content management solution that allows organizations to set up internal pages and share documents, has just got a big update with the new Modern Page Templates. Microsoft said that it’s going to be rolling out the feature to customers globally between early July and early August.
Organization members that want to set up pages on SharePoint using the new templates can do so from multiple entry points including the Site Home (the home of a Communication or Teams site), App Bar (the persistent navigation pane on the left of SharePoint), and the New Web Part (a webpart that displays and creates news posts directly on pages). By giving colleagues multiple access points to the new templates, there’s more chance they’ll be found and used.
By including plenty of swanky templates, Microsoft is making it so you can spend less time designing pages, and more time filling them with content that really matters. If you want to create a new page using the templates, just go to New > Page and select a template “From Microsoft”. If you were making a news post, you would go to New > News post then you’d be presented with the new Template Gallery where you can select a custom template created by your colleagues under “Saved on this site”.
While these new templates are coming to customers globally next month, Microsoft is already busy working on new features to make templates easier to discover and make them more useful. For example, it is building tenant-wide custom templates that can be published across sites for organization-wide use, and it’s working on Copilot templates that you can use when creating pages with Copilot. Neither of these features was given a release timeline.
Customers won’t need to do anything to start using Modern Page Templates as they’ll be available automatically as it rolls out worldwide across tenants. For those who want to dive deeper, Microsoft will be publishing additional documentation and guidance about this feature soon.
Question
stumper66
Hello,
I have a file copying program and I have a custom class that utilizes a System.IO.FileSteam to copy a file to a destination computer. For the most part it works quite well. However I use it to copy to many remote locations. Some of them have subpar network connections. Every so often I'll get a server that has a unreliable network connection and it will momentarily drop off the network for a few seconds. When this happens my FileStream breaks with the exception "The specified network name is no longer available.". This is expected.
However the problem is after the program has waited 60 seconds it will retry the transfer. The problem now is it can't even start because I get the error "The process cannot access the file '\\MyServer\c$\MyFile.zip' because it is being used by another process". I'll continue to get this error indefinitely until I close the program and restart the transfer, then it is able to transfer once again.
It would appear that my source server still has a file handle open when this happens that's preventing the transfer again and closing the program releases it. I would like to programically release the handle so I can restart the transfer automatically.
Here's what I've tried so far:
When the file transfer is started, I grab the FileSteam.SafeFileHandle to a variable. When I get the above error, I've tried accessing SafeFileHandle.SetHandleAsInvalid(), SafeFileHandle.DangerousRelease() and SafeFileHandle.Close(), but I'll still get the file in use error when I retry.
Link to comment
https://www.neowin.net/forum/topic/1204735-filestream-the-process-cannot-access-the-file/Share on other sites
12 answers to this question
Recommended Posts