I was wondering if it would be possible to create a C++ environment variable using C++ CGI variable. I was thinking something along the lines of a temp environment variable so that I could share data between two CGI programs.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Conceptually, environment variables being set from (inside) a process, which a CGI program is, only exist for the lifetime or in the scope of that process. They are only “visible” (or accessible) for that process or (possibly) its children.
Also, environment variables are not ‘C++’ specific, but an operating system (or shell, depending on where you come from) feature.
Even if it would be possible, it is arguably not a good idea to exchange data in that way. You could not (reliably/easily) address issues like concurrent modification, etc. with environment variables.
You should look into other concepts of IPC (interprocess communication).