Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:58:19+00:00 2026-06-10T10:58:19+00:00

I try to integrate lua to my project (lua 5.2.1) And i have no

  • 0

I try to integrate lua to my project (lua 5.2.1)
And i have no problem to compile it.

But my problem is my project use my own system for read/write file from the file system.

So I start to modify lua for replacing each call of fopen / fclose / fread / fwrite …

But the problem is Lua is too much mix if stdio fct ans use some FILE function I don’t have equivalent in my project (and no so easy to reimplement), like :
ungetc
setvbuff

And so on….

My question ^^
Some aleeady try to do that ? And if yes how ?
Does someone now a extension of lua who have this functionality (some c library use callback fct to ask open/close a file) ?

It’s seams strange to me that lua who is really use on multi-platfroms os or even embeded system make a so strong use of std lib, abitualy for really cross platform lib every type and fct from std are typedefed for easy platfroms specifics change.

Thanks for any help you can give me 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:58:21+00:00Added an answer on June 10, 2026 at 10:58 am

    You’re not asking about “Lua the language’s” file IO; you’re talking about “Lua the C library’s” file IO. This was not clear from the question.

    Lua has provisions for this. luaL_loadfile, for example, is just syntactic sugar around a function that opens the given file, loads it, closes the file, and then calls luaL_loadstring on it.

    If you’re in an environment where file IO has to go through different channels, you shouldn’t be trying to make luaL_loadfile work with the new file IO. You should be writing a new function which loads a file from your filesystem and calls luaL_loadstring.

    In short: you shouldn’t be using any Lua APIs that require files. Lua’s file-based functions are convenience functions; nothing more. Lua itself already has provisions for this; every file-based API has a non-file-based version that can work just as well. You should not be modifying Lua itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe my problem is in a settings file somewhere, but I have no
i try to integrate Lua in a embedded project using GCC on a Cortex-M4.
I try to integrate dokuwiki with mantis. -> DokuWiki Integration I use mantis 1.1.6
I just try to integrate ImageMagick into my PHP project. I installed and just
I try to integrate iAd to my App. I have a class SwitchViewController (:
I am try to create Phonegap project in which i need to integrate ASIHTTPRequest
I'm trying to integrate posting to one's wall from within my app.i try this
I came across an interesting but rather annoying problem. I am trying to integrate
I have to integrate my CardScan (from http://cardscan.com/ ) with my PHP so I
I have been working three days straight to try and integrate ads into my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.