copying and pasting

This is a discussion on copying and pasting within the C Programming forums, part of the General Programming Boards category; Hi all, How do I copy a file from one folder and paste it into a different folder? o.s:windows 2000 ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    4

    copying and pasting

    Hi all,

    How do I copy a file from one folder and paste it into a different folder?

    o.s:windows 2000
    compiler: visual c++

    thanks in advance,
    Cathal

  2. #2
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    You open the file you want to read, you open the file you want to write and start copying stuff from one file to another.
    This should of course be done with checking for errors.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    4
    i should have specified that the file is actually an image file.
    i'm just thinking that the best way to do it would probably be to use the "system()" function in conjunction with the dos "copy" command?

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    SHFileOperation() does what you are looking for.

  5. #5
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    ermm... The system() call is usually evil.

    If the file is an image, then you probably need to open it with the "binary option" enabled (that's adding a "b" in fopen, although not at the beggining of the options list, man, that kept me a few days fixing other stuff thinking it was that).
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying and pasting into terminal while typing
    By sean in forum Linux Programming
    Replies: 3
    Last Post: 01-23-2009, 03:05 PM
  2. Pasting data from clipboard
    By dean11 in forum C++ Programming
    Replies: 4
    Last Post: 09-08-2005, 06:48 PM
  3. copying and pasting from emacs
    By curlious in forum Linux Programming
    Replies: 1
    Last Post: 12-13-2003, 10:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21