Jump to content
  • Advertisement
Sign in to follow this  
jeff8j

virtual c file descriptor

This topic is 2152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a library that takes a file descriptor to read from but im trying to make it read from a http location and the only way I can think of to do such is to create a virtual file and handle all the http overhead myself but I cant find anything that remotely hints over riding a file descriptor is possible. So is it possible if so is there any tutorials?

Share this post


Link to post
Share on other sites
Advertisement
On most operating systems that use file descriptors you can create a pipe, which will give you a readable and a writable file descriptor. You can then pass the readable file descriptor to functions that require file descriptors and write arbitrary data to the writable file descriptor.

Share this post


Link to post
Share on other sites
Hmm that looks like what I need would I have to store the whole file in memory or could I stream it in?

Share this post


Link to post
Share on other sites
You would probably be able to stream it in, but without knowing more details about what you were doing, it would be impossible to say for sure.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!