473,378 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Copying a file that is open?

This may seem a stupid question, but is it possible to copy a file that is
open? I have written an application to dispaly TIFF, RTF and other file
formats. I now need to add a function that will copy a file being displayed
to another directory, whilct leaving the original behind? Can anyone suggest
a way that I might do this? It is important for my user that I display the
file. I use a 3rd party control for the TIFF and the MS DSOFramer control
for the rtf file. Thinking about this as I write, I think that I may be able
to do a 'save' on these 2 file types using the relevant controls. However
there are other files that I cannot do this with. Presumably I have to close
the files in my code, then copy, then open them again, or is ther an easier
way of doing this??

Many thanks

Paul Bromley
Nov 21 '05 #1
2 882
Stupid Me!!!

I was trying to copy to a Network drive that I only had read properties on.

Sorry for bothering you.

Paul Bromley
"Paul Bromley" <fl*******@dsl.pipex.com> wrote in message
news:uu****************@TK2MSFTNGP10.phx.gbl...
This may seem a stupid question, but is it possible to copy a file that is
open? I have written an application to dispaly TIFF, RTF and other file
formats. I now need to add a function that will copy a file being displayed to another directory, whilct leaving the original behind? Can anyone suggest a way that I might do this? It is important for my user that I display the
file. I use a 3rd party control for the TIFF and the MS DSOFramer control
for the rtf file. Thinking about this as I write, I think that I may be able to do a 'save' on these 2 file types using the relevant controls. However
there are other files that I cannot do this with. Presumably I have to close the files in my code, then copy, then open them again, or is ther an easier way of doing this??

Many thanks

Paul Bromley

Nov 21 '05 #2
Oh, well just in case you need it, you could use:
1. FileSystemObject (COM) - known as Microsoft Scripting Runtime
2. The System.IO namespace in .NET

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Bryan Rickard | last post by:
I wrote a simple program in VB6 to copy all the files from a directory on a CD-ROM to my hard disk. There are about 10 files, each about 30MB. The program uses Get and Put to get data from the...
3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
6
by: Jim Heavey | last post by:
I have written a little application which copies files from one location to another location. Before it copies the file, it ensure the directory for both the from and to locations is valid. It...
3
by: Daz | last post by:
Hi everyone! This is my first time posting in this group, although I have been watching it for the past few months and have to say this is possibly the best group I have seen on Google so far!...
3
by: John | last post by:
Hi all, My application updates a sql server 2005 express database prior to copying it with the result being the "in use by another process" and I cannot copy it as a result. I've posted the code...
2
by: jatphat | last post by:
Somebody help me. How do i copy my Access database from one location on my hard disk to another . i tried file.copy(source, distination ) but the file would not move. i always get this error ...
18
by: mike3 | last post by:
Hi. I have an interesting problem. The C program presented below takes around 12 seconds to copy 128 MB of data on my machine. Yet I know the machine can go faster since a copying done at a...
13
by: writeson | last post by:
Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to...
0
by: Michiel Overtoom | last post by:
Ethan wrote: Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a file that's still open for writing by another process, at least not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.