self copying

This is a discussion on self copying within the C++ Programming forums, part of the General Programming Boards category; how can you make a file copy itself?...

  1. #1
    Banned
    Join Date
    Oct 2004
    Posts
    250

    self copying

    how can you make a file copy itself?

  2. #2
    Registered User MathFan's Avatar
    Join Date
    Apr 2002
    Posts
    190
    u mean an exe-file?
    The OS requirements were Windows Vista Ultimate or better, so we used Linux.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    Or like a virus - who knows.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Banned
    Join Date
    Oct 2004
    Posts
    250
    a TXT file but it would be handly if i knew how to copy a .exe file

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    You mean like from the command prompt

    copy c:\from\here.txt c:\to\there.txt
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Banned
    Join Date
    Oct 2004
    Posts
    250
    no i want a program to automatically copy itself a certain amount of times when ran is there anyway to do that?

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    I can think of no good reason why you'd want to do that. The solution, however, is simple if you think about it.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  8. #8
    Banned
    Join Date
    Oct 2004
    Posts
    250
    well vould you give me a little hint im new to C++

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    If you're new to C++, this shouldn't be a first project. Try learning the language before you do stupid things like this. The last thing we need are more poorly written viruses...er..self-replicating programs.

    Quzah.
    Hope is the first step on the road to disappointment.

  10. #10
    Banned
    Join Date
    Oct 2004
    Posts
    250
    no its not for a virus is anyone going to help me?

  11. #11
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    Nope
    Woop?

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    > no i want a program to automatically copy itself a certain amount of times when ran
    Sure sounds like it to me.
    What could be the benefit of that, apart from filling up your disk with copies ?

    > a TXT file but it would be handly if i knew how to copy a .exe file
    A TXT file does not execute (unless M$ really screws up and makes them executable the same way they've gone with JPG files).

    > no its not for a virus is anyone going to help me?
    Not me.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  13. #13
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,262
    Give us a good reason why a program would need to make copies of itself, and maybe someone will help you then.

  14. #14
    Banned
    Join Date
    Oct 2004
    Posts
    250
    well im trying to make a program that will make a copy of itself before destroying itself

  15. #15
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    It's not reliably possible in pure standard C++.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying Files
    By ch4 in forum C Programming
    Replies: 8
    Last Post: 02-14-2009, 04:15 PM
  2. Deep and Shallow Copying
    By peckitt99 in forum C++ Programming
    Replies: 4
    Last Post: 08-18-2007, 10:37 PM
  3. Copying a whole directory and its content
    By Enira in forum C Programming
    Replies: 4
    Last Post: 03-12-2006, 02:13 PM
  4. Shallow/Deep copying, pointers
    By littleweseth in forum C++ Programming
    Replies: 3
    Last Post: 11-26-2003, 06:36 PM
  5. Copying a file
    By rkjd2 in forum C++ Programming
    Replies: 5
    Last Post: 09-09-2001, 11:24 AM

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