Solved

Saving or using CStdioFile* returned by OpenURL

Posted on 1997-09-27
3
438 Views
Last Modified: 2013-11-19
I'm kinda new to this and I am trying to use OpenURL to get
an FTP file.  I have the binary flag set and the member variable for the CStdioFile is the file on the remote Ftp server...How can I save this to disk?  I guess this is a generic CStdioFile question.
0
Comment
Question by:bsturk
3 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1307050
If you have a CStdioFile*, you can always use CStdioFile::Read() to read from the "file". Then once you have the string, you can do anything you want with it, such as save it to disk, etc.

0
 

Author Comment

by:bsturk
ID: 1307051
I've since figured out the Read() thing and am using a progress control while I read.  But how do I save that dang thing?  If it's a compressed file how can I detect the eof?  Do I have to use c run-time stuff like FILE?
0
 
LVL 1

Accepted Solution

by:
TKII earned 50 total points
ID: 1307052
If you are using Read to read from FTP you have to specify a buffer and the size of this buffer. Read returns the number of read bytes to you. So I think you should open a second file (CFile) and write the received number of bytes from the buffer to the new file. If Read tells you that 0 (zero) bytes were read then you have the reached the eof.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now