Help with I/O

This is a discussion on Help with I/O within the C++ Programming forums, part of the General Programming Boards category; I'm working on a program to extract the flash file locations from a web page. I can get the ifstream ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    3

    Question Help with I/O

    I'm working on a program to extract the flash file locations from a web page. I can get the ifstream working for a local file, but the second I introduce the http protocol, it doesn't. Maybe I'm using the completely wrong method. Please Help!

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    ifstream objects only read local files.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    3
    how can I read an internet file then?

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    What O/S are you using?

    You need to create a socket object of some sort, bind a port, connect to the server, download the file, and then analyze. C++ does not currently support this within the standard library. It's O/S specific. It's not a task for a newbie.

    You could probably find libraries that support doing this kind of stuff for you, however, so it might be easier if you go that route.

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    3
    I'm using Windows.

  6. #6
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Winsock is the socket system you need to write for if you want to do it natively and completely manual:

    Google: Winsock tutorial

    Otherwise, look for libraries. I haven't really looked into boost, but heck, it seems to have a lot of features.

  7. #7
    l2u
    l2u is offline
    Registered User
    Join Date
    May 2006
    Posts
    630
    Use asio if you're going to use boost.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. asynchronized I/O == multiplexing I/O?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 07-24-2006, 10:06 AM
  2. why page based I/O can improve performance?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 06-12-2006, 07:42 AM
  3. Nonblocking I/O
    By fnoyan in forum Linux Programming
    Replies: 4
    Last Post: 11-29-2005, 03:37 PM
  4. Overlapped I/O and Completion Port :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 10-30-2002, 04:14 PM
  5. WSAAsyncSelect I/O Mode :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 1
    Last Post: 05-12-2002, 03:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21