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

  • Home
  • SEARCH
  • 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 6471851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:16:23+00:00 2026-05-25T06:16:23+00:00

I was looking to find a way to use include statement using a fifo

  • 0

I was looking to find a way to use “include” statement using a fifo (named pipe) file created with posix_mkfifo. As my expectations were high I got very depressed to see the page blocked, waiting for an action that I was sure it won’t ever happen.

So… my logic dictated that as “include” surely use some kind of “fopen”-family function, and fifos can be opened this way, my only thing to do was: to create one, then write in it, maybe keep the resource alive until it was included, include the file, close the handler, delete the file. But of course it was nothing like that. I suppose that include opens the file in a blocking manner and this behavior is the cause of my problem.
Having worked with fifos in c, I noticed that in a non-blocking open method the information in fifo is preserved until a reader decides to read it. I was hoping on the same behavior.

Although I tried to open another page to write to the same fifo, so that the reader can continue, that was bound to fail also. Furthermore, not only the page did not respond anymore, but it failed to answer to the user abort also, fact due to I had my sessions blocked for several minutes, as session_start() would tell me that there cannot be used by two processes at once ( I might be wrong here about the error message, I can remember well, and I have deleted the test files. )

My question is if there is any way to achieve this effect: of including using a fifo.

In the end,
to answer all the questions about why the hell am I doing this I will say that my system puts itself between the real code and it’s processing with the purpose of modifying it on need in a dynamic manner, completely reversible. And for that it needs to read the original file, check the code, change it when it seems to and then write it in a file, in a new “root” folder, keep the folder and files hierarchy and then “include” the file.
At the moment, I replaced the use of fifos with the one of real files, but I need to filter a lot of code. And eval, although overused in my functions, is not a solution as it do not keep the current directory and the script name, or anything specific to an actual file, besides that it is very sensible with many things, especially with relative paths, and weird uses of php syntax. So I am still stuck with writing in files.

Because of that the system is a terrible time consumer and a bad resource manager, my original idea was to write in fifos that are more light, kept in memory, volatile, and really made for the only purpose of IPC.

With respect,
paul

  • 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-05-25T06:16:23+00:00Added an answer on May 25, 2026 at 6:16 am

    As suggested in a comment, I’ll elaborate it a bit: Write your own stream wrapper and then you can register it on top of a protocol:

    stream_wrapper_register("myfilter", "WrapCode");
    
    include('myfilter://path-to-include');
    
    # or
    
    include('myfilter://file://path-to-include');
    

    That done, inside your WrapCode stream wrapper class, you can open a stream to the original resource and then process it on the file transparently. This would be on-the-fly, so you don’t need to care about storing your files somewhere (but you still can do so).

    The PHP Manual offers an example with a simple stream wrapper class which shows how it works.

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

Sidebar

Related Questions

I'm looking for a way to find out the URL of a SWF using
I'm looking to find a way to access the .net query string contained in
I am looking to find a way to programatically (C++) control/secure access to the
I've tried to find a way to do this, but without success. I'm looking
I'm looking for a way to find the name of the Windows default printer
I'm looking for a way to find references to a web method in other
I'm looking for a way to find the status of a live stream through
we are looking for a way to find out (not modify, just find out)
I'm looking for a way to find/replace links to images (within user-generated content) without
I'm looking for an easy way to find the process tree (as shown by

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.