• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to read a text file over a network
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read a text file over a network


  • Subject: Re: How to read a text file over a network
  • From: Wim Lewis <email@hidden>
  • Date: Mon, 13 Dec 2010 10:51:27 -0800

On 13 Dec 2010, at 4:54 AM, Abhijeet Singh wrote:
>  My question is if user wants to define some network file path then:How to define a network file path? (I tried keeping file1.txt over a network and define its path as given in "Get Info" panel in file2.txt)How to read a file over a network? (I am reading file using C functions fopen, fscanf, fgets. Do i need to use any function from cocoa?)

If file2 is specified using a URL, you can do this the Cocoa way with NSURLDownload, etc.; or you can use the CFStream API (e.g. CFReadStreamCreateForHTTPRequest or  CFReadStreamCreateWithFTPURL) if you know that it's a specific kind of URL and you like the stream interface. (However, I've found the CFStream API to be kind of buggy.)

You can also use libcurl, an open-source library that ships with MacOSX. Libcurl is less cocoa-y but is very flexible.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to read a text file over a network (From: "Abhijeet Singh" <email@hidden>)

  • Prev by Date: Using bindings to lessen amount of code
  • Next by Date: assign property behaves differently from simple instance variable???
  • Previous by thread: Re: How to read a text file over a network
  • Next by thread: Re: How to read a text file over a network
  • Index(es):
    • Date
    • Thread