C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 23rd, 2003, 08:03 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
copy jpg

I can't seem to find any source code that has this done already. Apparently this will be a bitch since it's not in binary mode? is that right?

Has anyone ever used C++ to copy a jpg file to another location on the computer? And if so can source code be pointed at for me or even just the copy command or what? I've seen some stuff but it was way over my head with 20 different module's and whatnots... there really has got to be an easy way to do it, and if not, can you tell me what language would it be easy in ... =)

Reply With Quote
  #2  
Old June 23rd, 2003, 08:43 PM
Jason Doucette's Avatar
Jason Doucette Jason Doucette is offline
jasondoucette.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada
Posts: 378 Jason Doucette User rank is Private First Class (20 - 50 Reputation Level)Jason Doucette User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 23 m 8 sec
Reputation Power: 6
All files are binary (even text files, for that matter). If you want a byte for byte copy of a file, it doesn't matter what its format is. Simply read in every byte of the source file, and write out every byte - exactly as is - to the destination file. Make sure you read it as binary, which means you read it into memory exactly as is, and write it out exactly as is. That's all a file copy command basically does.

You can speed up the process by reading in as much as the file as possible before writing it out so there isn't a significant amount of disk activity to go back and forth (if you are copying it to the same drive).

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > copy jpg


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway