Solved

Saving or using CStdioFile* returned by OpenURL

Posted on 1997-09-27
3
436 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 127
maxBlock challenge 30 100
Doc'in system (example?) BA 7 79
Detect file exist or not 3 81
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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…

759 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

21 Experts available now in Live!

Get 1:1 Help Now