Copying a microsoft word doc

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2009
Posts: 14
Reputation: shealy is an unknown quantity at this point 
Solved Threads: 0
shealy shealy is offline Offline
Newbie Poster

Re: Copying a microsoft word doc

 
0
  #21
Jul 6th, 2009
if I ftp any work doc in binary format or asicc format and view the resulting file they are all fine. ftping the copied file that my binary creates does not work fine. So not too sure it's an ftp issue.

What o/s are you using to copy file?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1468
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Copying a microsoft word doc

 
0
  #22
Jul 6th, 2009
Oh, I just saw the attachments. Downloaded input.doc and my program copied it correctly, as expected. The output.doc file you attached is unreadable for me too, so the problem is either in the ftp or the solaris operating system. My guess is the ftp program is corrupting the output file.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1468
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Copying a microsoft word doc

 
0
  #23
Jul 6th, 2009
Originally Posted by shealy View Post
if I ftp any work doc in binary format or asicc format and view the resulting file they are all fine. ftping the copied file that my binary creates does not work fine. So not too sure it's an ftp issue.

What o/s are you using to copy file?
I am using Microsoft Vista Home Premium and VC++ 2008 Express compiler. No FPT involved. Are you using the code I posted or something you wrote ?

Where did the input.doc file come from that you posted? Was it also FTPd to Windows machine before you posted it here? Or did you post it directly from a browser running on Solaris os ?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Copying a microsoft word doc

 
1
  #24
Jul 6th, 2009
I agree with AD that the FTP is probably what is going wrong.

FTP defaults to text mode. You must explicitly set it to binary mode before copying files.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 14
Reputation: shealy is an unknown quantity at this point 
Solved Threads: 0
shealy shealy is offline Offline
Newbie Poster

Re: Copying a microsoft word doc

 
0
  #25
Jul 6th, 2009
I wrote two programs - one with an fstream read and write and the other has the code provided in the example above. Both produced the unreadable doc.

I really don't think it's anything to do with ftp. I can ftp any word doc from the server to the desktop and vice-versa in binary mode without any issues - the ftp'd file which has graphics, fonts etc can be opened successfully.

The original input file was ftp'd from the desktop on to the solaris server in binary format.

Originally Posted by Ancient Dragon View Post
I am using Microsoft Vista Home Premium and VC++ 2008 Express compiler. No FPT involved. Are you using the code I posted or something you wrote ?

Where did the input.doc file come from that you posted? Was it also FTPd to Windows machine before you posted it here? Or did you post it directly from a browser running on Solaris os ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1468
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Copying a microsoft word doc

 
0
  #26
Jul 6th, 2009
The problem could also be one of Endianness. The byte order on windows and *nix computers are reversed. Maybe your os is writing the bytes out in reverse order during the copy process. To test that use your system's command-line copy function to make the copy, FTP to Windows and check it with MS-Word.
Last edited by Ancient Dragon; Jul 6th, 2009 at 5:48 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 14
Reputation: shealy is an unknown quantity at this point 
Solved Threads: 0
shealy shealy is offline Offline
Newbie Poster

Re: Copying a microsoft word doc

 
0
  #27
Jul 6th, 2009
To eliminate ftp as an issue. I ftp'd a doc from desktop to server. ftp'd the doc back to desktop to different location and doc opened successfully.

Copying a doc on server and then ftping is also successful when opening using ms-word.

Does this just leave us with sun solaris?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1468
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Copying a microsoft word doc

 
0
  #28
Jul 6th, 2009
did you try my previous suggestion yet?
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 14
Reputation: shealy is an unknown quantity at this point 
Solved Threads: 0
shealy shealy is offline Offline
Newbie Poster

Re: Copying a microsoft word doc

 
0
  #29
Jul 7th, 2009
Yes - see previous response - I did the unix copy command, ftp-d to windows and opened with ms-word successfully.

Originally Posted by Ancient Dragon View Post
did you try my previous suggestion yet?
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 14
Reputation: shealy is an unknown quantity at this point 
Solved Threads: 0
shealy shealy is offline Offline
Newbie Poster

Re: Copying a microsoft word doc

 
0
  #30
Jul 7th, 2009
Solved it. The issue is with the read() and write() methods. Using get() and put() works successfully.

Thanks to all who helped.
[

QUOTE=Ancient Dragon;910063]did you try my previous suggestion yet?[/QUOTE]
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC