copy

Copy tables from one database to another in SQL Server.

I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this? ...

How to say no to all "do you want to overwrite" prompts in a batch file copy?

By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location. You can add "/Y" to say "Yes to all" replacements. But how can you say "No to all" ? In other words, I want to copy everything from one directory that does not already exist in the target. The closest thing I see ...

File security attributes getting screwed up on file copy

I've a windows service that updates our product. It copies the product files into a temp directory, usually "C:\Windows\Temp", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually "C:\Program Files\Product". The files in the install directory are inheriting their security att...

Managing file uploads in JSP/Servlets

Once again a very beginner-ish question, but here I go: I would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload and IO libraries. Is there no easier or more elegant solution?...

Effective copying multiple files

I have to copy quite a lot of files from one folder to another. Currently I am doing it in this way: string[] files = Directory.GetFiles(rootFolder, "*.xml"); foreach (string file in files) { string otherFile = Path.Combine(otherFolder, Path.GetFileName(file)); File.Copy(file, otherFile); } Is that the most efficient way? Seem...

Subversion, external references, binaries, and MSBuild/Visual Studio

I have a project that is stored in a Subversion repository. In this repository, in a different folder, I have a set of libraries that I use in many of my projects. These libraries are stored as binary files, ie. the dll's, pdb's, and xml's. Here's an example layout: <repo-url> \Libraries \SQLite \SystemHooks ...

How can I copy a directory recursively and filter filenames in Perl?

How do I copy a directory including sub directories excluding files or directories that match a certain regex on a Windows system? ...

What is the best way in Perl to copy files into a yet-to-be-created directory tree?

What is the best way in Perl to copy files to a yet to be created destination directory tree? Something like copy("test.txt","tardir/dest1/dest2/text.txt"); wont work since the directory tardir/dest1/dest2 does not yet exist. What is the best way to copy with directory creation in Perl? ...

How can I create a copy of an Oracle table without copying the data?

I know the statement: create table xyz_new as select * from xyz; Which copies the structure and the data, but what if I just want the structure? ...

How do you automate copying file with path too deep issues in Windows?

I want to be able to selectively copy a list of files and preserve their directory structure. The problem is that there are quite a few files that their path exceeds 256 character. How is this problem usually handled? Edit: I should make it clear that I only want to selectively copy files, not folders. I don't think robocopy can be e...

system() copy fails, while cmd copy works

In cmd.exe, I can execute the command "copy c:\hello.txt c:\hello2.txt" and it worked fine. But in my C program, I ran this piece of code and got the following error: #include <iostream> using namespace std; int main() { system("copy c:\hello.txt c:\hello2.txt"); system("pause"); return 0; } Output: The system cannot fi...

How do you copy the contents of an array to a std::vector in C++ without looping?

I have an array of values that is passed to my function from a different part of the program that I need to store for later processing. Since I don't know how many times my function will be called before it is time to process the data, I need a dynamic storage structure, so I chose a std::vector. I don't want to have to do the standard...

In SVN, how do I copy just the subdirectories of a directory to another directory?

Via command line, I usually do this: cp -rRp /path/to/a_folder/. /path/to/another_folder This copies just the contents underneath a_folder to another_folder. In SVN I need to do the same thing, but can't figure it out. I always end up with this: /path/to/another_folder/a_folder SVN throws up even when I try this: svn copy file:///pa...

Function parameters: Copy or pointer?

I'm kind of new to C++ and have some questions, this is one of them. Is there ANY reason when you are using a function that takes in one or several parameters, parameters of which you know will always be stored in a variable before the function call, to pass a copy of the variable, rather than a pointer to the variable? I'm talking in...

There's a way to declare Copy Constructor non-public AND using default copy Constructor?

I have a not-so-small class under development (that it changes often) and I need not to provide a public copy constructor and copy assignment. The class has objects with value semantics, so default copy and assignment work. the class is in a hierarchy, with virtual methods, so I provide a virtual Clone() to avoid slicing and to perform ...

Copy Directory to Output Directory - Console Application .NET

Is there a way to copy an entire directory to the output directory in a console application in C#.NET? I know for files you can right click them, properties and mark copy to output directory. But I'm not going to do that for 20.000 files... Thx, Lieven Cardoen aka Johlero ...

RAPI copy file using OpenNETCF.Desktop.Communication.dll

Hello all, I’m currently using the OpenNETCF.Desktop.Communication.dll to copy files from my desktop to a CE device, but I keep getting an error: ‘Could not create remote file’ My development environment is VS2005 (VB.NET) My code: ObjRapi.Connect() ObjRapi.CopyFileToDevice("C:\results.txt", "\results.txt") ObjRapi.Dispose() ObjRapi...

How does one copy a dialog resource from one project to another in Visual Studio 6.0 or Embedded VC++ (eVC)?

I've got two branches of code. 1 has a dialog box that the other doesn't, but because of politics the dialog box wasn't moved into the newest branch. Now they want it in... So is it possible to copy a dialog box from one project to another. There apears to be an export and import feature however it's greyed out. ...

Automatically copying files from a Linux machine to a Windows machine

I need to automatically copy files from a linux machine to a windows one every day. I'm looking for something simple and secure like scp, rsync, sftp. Unfortunately, I'm at a loss of how to set this up on the Windows machine. Does anyone know how to do this? ...

How do I copy files with specific file extension to a folder in my python (version 2.5) script?

I'd like to copy the files that have a specific file extension to a new folder. I have an idea how to use os.walk but specifically how would I go about using that? I'm searching for the files with a specific file extension in only one folder (this folder has 2 subdirectories but the files I'm looking for will never be found in these 2 su...