Avatar of tonelm54
tonelm54
 asked on

Shadow open a file

I'm trying to backup a file to a web-service which I'm trying to upload segments, I've managed to get it working however I've now got a problem where the files are in use so I want to be able to create a shadow copy of the file and then open the file as a stream read and the read segments of the files.

What I have is now a problem as I have no idea how to create a shadow copy of a file and open a read stream to it. Im sure in .net 4 there is a method to shadow copy a file, but cannot find any documentation to it.

Any ideas?
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Jacques Bourgeois (James Burger)

8/22/2022 - Mon
kaufmed

The only time I've ever heard of "shado copy" pertains to .NET assemblies. Why do you think you need shado copy here?
ASKER CERTIFIED SOLUTION
Jacques Bourgeois (James Burger)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kaufmed

@James

Ah. So it overrides file locking then? Because I know that if a program doesn't open a file with an exclusive lock, then you can still read it even if it's in use.

On a side note, there must be an EE goblin loose, stealing all of the Ws. I can't otherwise explain how I misspelled "shadow" twice    XD
Jacques Bourgeois (James Burger)

I do mostly database work nowadays, so I haven't worked with files for a long while. But won't opening a file for writing automatically prevents reading by default?

As for the gremlins, I haven't been young for a long while either, so I might be out of touch about there current behavior, but in my times, they were usually in greater number around this time of the year. Simply improve the security in your brain by wearing a hat all the time, and you should be OK.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck