Solved

Saving or using CStdioFile* returned by OpenURL

Posted on 1997-09-27
3
450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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