Menu

Copy a jpeg file

2009-10-25
2012-09-26
  • Chris Davidson

    Chris Davidson - 2009-10-25

    I have two stibgs. One string holds the name of a jpeg file. The other string
    holds the new name I want for the jpeg file. How would I proceed to do this. I
    would think it would be easy but I just can not figure it out. Thanks in
    advance for any assistance that can be given.

     
  • Chris Davidson

    Chris Davidson - 2009-10-25

    I ment to say I have two strings, not two stibgs.

     
  • cpns

    cpns - 2009-10-26

    You can invoke an OS shell command to do it via a system() call, or you can
    open the file for "binary read", and create the new file as &quot
    ;binary-write", and read blocks from one and write them to the other.

    The latter method is portable, the first method depends on the OS shell and
    commands available, so is not portable between different OS's

     
  • Chris Davidson

    Chris Davidson - 2009-10-26

    Thanks for the help. It took a bit of doing but I have the program copying the
    jpegs perfectly.

     
  • cpns

    cpns - 2009-10-26

    Ah... Probably a bit late to suggest a third option then: . Note that this is
    definitely specific to Win32, but far more flexible and efficient that using
    system(), which has no way of telling whether the command executed by it
    succeeded.

    : http://msdn.microsoft.com/en-
    us/library/aa363851%28VS.85%29.aspx

     
  • Anonymous

    Anonymous - 2009-12-30

    Thanks cpns for this useful source.
    I am here too for sharing knowledge and solve my problem

     
  • cpns

    cpns - 2009-12-31

    David; please stop digging up dead threads merely in order to add no content.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.