copying

Copying plist file to custom folder in ApplicationSupport (Objective-C)

I have this piece of code, which copies a plist file to the ApplicationSupport directory in the users folder. NSString *resourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:kAutonumberPlist]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); ...

Copy a file from /file to /folder/file

Hi. I have been working on an app for a while now, and it is supposed to copy files. I have the code: - (IBAction)moveFile:(id)sender { NSFileManager *filemgr; filemgr = [NSFileManager defaultManager]; NSString *fileToMove = [NSString stringWithFormat:@"%@", "TestText.txt"]; if ([filemgr copyItemAtPath: fileToMove toPath: @"./T...

copying text to a character array from a text file in C?

Hey there, How do I go about copying text inside a text file into a multidimensional character array? supposing the text file( text_file.txt) contained this is the first line this is the second line this is the third line #include <stdio.h> int main(void){ FILE *f; f=fopen("text_file.txt","r"); if (f==NULL){ printf(...

Visual Studio 2008 project reference

I have a problem with the "Copy to output" functionality in Visual Studio 2008. Maybe I'm misunderstanding how its supposed to work. I have a solution with four projects: TestApp1 (Windows application) TestAppA (Windows application) TestProj1 (Class library) TestProjA (Class library) The dependencies are as follows (dependency as in...

Is it unethical to copy JavaScript or HTML from another website?

If there's an existing website that has the exact feature I'm trying to implement and I can see the implementation by viewing the page source or viewing the included JavaScript files, is there anything wrong with copying it? ...

getting list without k'th element efficiently and non-destructively

I have a list in python and I'd like to iterate through it, and selectively construct a list that contains all the elements except the current k'th element. one way I can do it is this: l = [('a', 1), ('b', 2), ('c', 3)] for num, elt in enumerate(l): # construct list without current element l_without_num = copy.deepcopy(l) l_witho...

Writing a batch file for date-based file copying

I need to make a batch file that can copy files from one path to another based on parameters. For example, typing "datecopy -m 8 c:/copyfrom/*.* d:/copyto/*.*", would find all files in c:/copyfrom dated less than 8 months old, and copy them to d:/copyto -folder. Alternately, instead of -m for month, I could use -h for hour or -y for yea...

Faster method for exporting embedded data

For some reasons, i'm using the method described here: http://geekswithblogs.net/TechTwaddle/archive/2009/10/16/how-to-embed-an-exe-inside-another-exe-as-a.aspx It starts off from the first byte of the embedded file and goes through 4.234.925 bytes one by one! It takes approximately 40 seconds to finish. Is there any other methods for ...

Progress during large file copy (Copy-Item & Write-Progress?)

Is there any way to copy a really large file (from one server to another) in Powershell AND display it's progress? There are solutions out there to use Write-Progress in conjunction with looping to copy many files and display progress. However I can't seem to find anything that would show progress of a single file. Any thoughts? ...

how to get files from one PC to another using c#.net?

im using c#.net..i want to get the files that are on the server PC to my PC..both the PCs are connected through network.. i have given IP address of that PC in the path...but its not copying the files to my folder. im using the following code ...but its not working..kindly help me out.. File.Copy(Path.GetFileName(sourceFile), Path.GetDi...

How to copy subversion repository as a new directory to existing repository?

I have two existing subversion repositories on different hosts (host-a and host-b) and I'd like to copy one directory from repo A to repo B. Basically https://host-a/repo/some/path/moduleA should be copied to https://host-b/repo/some/other/path/moduleA. All the history should be preserved and existing data in host-b should be preserved....

How to copy a file using Paperclip

Does anyone know of a way to copy files with Paperclip using S3 for storage? Before I try to write my own, I just wanted to make sure there wasn't already a way to do this. Thanks ...

copying the contents of a binary file

I am designing an image decoder and as a first step I tried to just copy the using c. i.e open the file, and write its contents to a new file. Below is the code that I used. while((c=getc(fp))!=EOF) fprintf(fp1,"%c",c); where fp is the source file and fp1 is the destination file. The program executes without any error, but the image...

NSFileManager - Copying Files at Startup

Hi, I need to copy a few sample files from my app's resource folder and place them in my app's document folder. I came up with the attached code, it compiles fine but it doesn't work. All the directories I refer to do exist. I'm not quite sure what I am doing wrong, could someone point me in the right direction please? NSFileManager*ma...

Does putting data into std::vector in C++ create a copy of the data?

I am interested if creating a new std::vector (or calling its assign method) creates a copy of the data? For example, void fun(char *input) { std::vector<char> v(input, input+strlen(input)); // is it safe to assume that the data input points to was COPIED into v? } Thanks, Boda Cydo. ...

Copying files across computers using SSH and MAC OS X Terminal

Im trying to copy my .profile, .rvm and .ssh folders/files to a new computer and I know how to use the cp and ssh commands but I'm not sure how to use them in order to transfer files from one computer to another. Any help would be great, thanks! ...

Copying binary file changes newline character to window's standard..? Java

Hello everyone! For some reason, this code is changing any '\n' characters from the input and replacing it with '\n\r' in the new outputed file. I reference a couple websites, and still haven't figured it out.. Anyone have an idea? Thanks a lot! Socket connectionSocket = sData.accept(); InputStream inputStream = connectionSocket.getInp...