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 6868627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:27:27+00:00 2026-05-27T03:27:27+00:00

in my previous question: Passing data between PHP and C executable in linux i

  • 0

in my previous question:
Passing data between PHP and C executable in linux
i was able to pass strings with

proc_open();

in PHP and

fget(stdin,"r");

in C
; after that, i used strtok(); to split up my string and turn them into values in C

is there any other ways to pass data structure?
since my way doesn’t seems to be a good idea

  • 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-27T03:27:28+00:00Added an answer on May 27, 2026 at 3:27 am

    On unix and therefore linux, text is the universal interface. You can pass text via stdin/stdout and parameters to scripts and binary programs, and also convey information with environmental variables. All you have to do is parse the text. But Data Structures like hash-maps,linked lists and tree sets,etc can not be passed between distinct processes.

    So using this methods are classics on command like scripts and binary programs, after that there is using file locking to read text file databases which is messy to say the least.

    And then is the realm of binary data passing between processes, which MUST be encoded in some kind of common protocol. Here you start playing with file pipes, unix sockets and network sockets.

    I won’t get into details of each, network sockets even the local loopback device is very favored today for universal client/server style of communication. because allows multiplexing of communications and is easily portable.

    I won’t give you code, you have plenty of data to google now and code for every single kind of communication would be way too big.

    Here are some tutorials on sockets:

    http://www.linuxhowtos.org/C_C++/socket.htm
    http://gnosis.cx/publish/programming/sockets.html

    AS one last caveat. Sockets are not as simple as stdin/stdout data passing, so your needs really must be complex enough to justify the use of sockets data transmision.

    stdin/stdout is practical for most wrapping situation, specially for glue code.

    Edit: there is also a "third option", using a database like mysql or postgres, where the sockets are wrapped by the database api. An the API and bindings for many popular languages as PHP, C, java, perl, python, ruby, etc, allow inter process data exchange in a ordered and safe way. But then you have to learn a database api, sql, maybe some normalization and best practices… Your experience and available features will be greater but not necessarily quicker or easier.

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

Sidebar

Related Questions

This is a follow up to my previous question: Problem passing parameters via Iframe
( NOTE: This is a follow up to a previous question, How to pass
This question depends my previous question: Browser crashes after 10-15 mins On that question
As a follow up to this previous question , I have a Core Data-based
From a previous question on Stackoverflow Iterating through/Parsing JSON Object via JavaScript .... My
In previous question of mine, someone had meantioned that using Semaphores were expensive in
This question is directly related to my previous question ASP.NET AJAX Is it possible
this question is an extension to a previous question i asked (and was answered).
This question is related to a previous question of mine That's my current code
This question follows on from a previous question, that has raised a further issue.

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.