Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-05

OT: CGI for apache with free pascal

41 messages · 12 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess
to Baeseman, Cliff: What is this easy cgi unit i see. Is there some way that I can use free pascal for…
Cliff wrote 5 lines
What is this easy cgi unit i see. Is there some way that I can use free pascal for apache for cgi. Mike H do you know anything about this?

Sure. I wrote it. It is EASY as the name says. I have to leave right now but when I get back this evening I'll send you a small demo showing how to use it. I wrote it to use with my IDKSM Search Engine.

You can do your whole CGI in about 3 or 4 lines of code. The rest is whatever the content you want returned in the HTML file.

Talk at you later,

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

Thanx Michael I would really appreciate that.

Cliff

Earlier message 32 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, May 19, 1999 4:00 PM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal Baeseman, Cliff wrote: > > What is this easy cgi unit i see. Is there some way that I can use > free pascal for apache for cgi. > > Mike H do you know anything about this? Sure. I wrote it. It is EASY as the name says. I have to leave right now but when I get back this evening I'll send you a small demo showing how to use it. I wrote it to use with my IDKSM Search Engine. You can do your whole CGI in about 3 or 4 lines of code. The rest is whatever the content you want returned in the HTML file. Talk at you later, -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

What is this easy cgi unit i see. Is there some way that I can use free pascal for apache for cgi.

Mike H do you know anything about this?

Cliff

Reply by email

Baeseman, Cliff

Just looking for a good reason to use linux and free pascal at work...

Cliff

Earlier message 32 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, May 19, 1999 4:00 PM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal Baeseman, Cliff wrote: > > What is this easy cgi unit i see. Is there some way that I can use > free pascal for apache for cgi. > > Mike H do you know anything about this? Sure. I wrote it. It is EASY as the name says. I have to leave right now but when I get back this evening I'll send you a small demo showing how to use it. I wrote it to use with my IDKSM Search Engine. You can do your whole CGI in about 3 or 4 lines of code. The rest is whatever the content you want returned in the HTML file. Talk at you later, -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…
Nicolas Aragon wrote 7 lines
Hello, > procedure DoPost; override; > procedure DoGet; override; Hmmm... it sounds as Java to me :)

Hehehehe - Notice that did you. :-)

I wrote routines to parse multipart/form-data contents (file uploads). Let's add them to the library. Could you send me the code? Or is it updated at contributed units page?

TEZcgi is part of the FCL. It is in CVS or you can get it in the fcl.zip. The file is ezcgi.pp.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Nicolas Aragon
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…

Hello,

procedure DoPost; override; procedure DoGet; override;

Hmmm... it sounds as Java to me :)

I wrote routines to parse multipart/form-data contents (file uploads). Let's add them to the library. Could you send me the code? Or is it updated at contributed units page?

BTW, it's also possible to write Windows ISAPI DLLs with FPC.

greetings

Nico

Reply by email

Michael A. Hess
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…
Cliff wrote
Thanx Michael I would really appreciate that.

Here is a very simple example of how to build a CGI app using FPC. What follows is a complete app that you can build and actually use as a CGI.

If someone needs more explaination please let me know. :-)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

program CGITest;
{$mode delphi}
uses classes, ezcgi;
// In the following class you only need to use either DoPost or DoGet
// depending on what type of CGI request you want to use. If you only
// are going to be making GET requests that you only need to define
// and override DoGet and like wise for POST requests.
type
   TCGIData = class(TEZcgi)
      procedure DoPost; override;
      procedure DoGet; override;
      procedure ShowStuff;
   end;
var
   cgiStuff : TCGIData;
// All output from the CGI must first begin with the WriteContent
// call. This places the passed information and the correct CR's
// required. In most cases you will always use it as shown below.
// However if you ever need to return content that isn't standard
// text/html this allows you to set what that content type is.
//
// The PutLine call just passes the information indicated out into
// the stream for return to the client browser.
procedure TCGIData.DoGet;
begin
   WriteContent('text/html');
   PutLine('++++++++++ Using GET +++++++++');
   ShowStuff;
end;
procedure TCGIData.DoPost;
begin
   WriteContent('text/html');
   PutLine('++++++++++ Using POST +++++++++');
   ShowStuff;
end;
// I wrote this method so that you can see everything that is passed to
// and stored by the TEZcgi class. It currently stores all normal CGI
// as well as everything passed to the CGI by the client. These
// variables can be accessed via the following properties.
//
// Values[Index : string];
// The Index data can be something like AUTH_TYPE, SCRIPT_NAME, or any
// standard HTML or CGI environment variable. This can also be the
// field name of the content being passed in a query string such as
// "name" found in  //URL/CGI/cgiapp?name=bob
//
// Another routine is availble GetValue(Index, defaultValue : string);
// This routine does the same as the property Values except it allows
// you to set a default value to be returned if no variable of type
// name index is found.
// This data is stored in a TStringList so you can retreive it by index
// as well if you know the index location of the information.
//
// The properties for doing this are Names[index : integer] and
// Variables[index : integer]. Names returns the name of the variable,
// this would be the data passed in the values or GetValue calls.
// Instead of returning the value "bob" it returns the value "name". The
// variables property returns the whole string so using the name example
// above it would return "name=bob".
//
// To determine how many environment variables have been stored you can
// use the VariableCount property.
//
// The following procedure loops through all of the enviroment variables
// and prints them back to the client. This is a good CGI example to
// show you exactly what information you have to work with.
procedure ShowStuff;
var
   loop : integer;
begin
   for loop := 0 to VariableCount - 1 do
      PutLine(Variables[loop] + '<BR>');
end;
// what follows is the actual program begin..end.
// The Create call for the class does all the work of the CGI loading
// the environment variables.
// The FName and FEmail data is used by the Error report. If the CGI
// doesn't work correctly for the user this data is included in an
// error report that is returned to the user which tells them who to
// inform and how.
// The Run command starts processing the CGI request and eventually
// calls either the DoGet or DoPost depending on the request type.
// I don't try and trap it but the class does raise an exception called
// ECGIException when some error is generated.
begin
   try
      cgiStuff := TCGIData.Create;
      cgiStuff.FName := 'Michael A. Hess';    // replace with your name
      cgiStuff.FEmail := '';// replace with your email
      cgiStuff.Run;
   finally
      cgiStuff.Free;
   end;
end.
==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Nicolas Aragon
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…

Hello,

Show quoted text 5 lines
> I wrote routines to parse multipart/form-data contents (file uploads). > Let's add them to the library. Could you send me the code? Or is it > updated at contributed units page? TEZcgi is part of the FCL. It is in CVS or you can get it in the fcl.zip. The file is ezcgi.pp.

So I had it. But trying to create a TEZcgi cgi exits with an "Out of memory" error. A plain CGI with just writeln's works OK.

I couldn't track where the error raises, except that it's in the constructor... I think I've read here that there were some problems with TStringList :-??
It's the only "do something" stuff in the constructor, but I can't test it now, I'll wait to the next cvs update. Anyway, I would appreciate if someone can tell me if this problem isn't only mine.

My code doesn't touch the constructor, just if you were asking :-)

BTW, what does "EZ" stands for in "TEZcgi"?

greetings

Nico

Reply by email

Baeseman, Cliff

That is for sure the ole TStrings error showing up.

Cliff

Earlier message 37 lines
-----Original Message----- From: Sent: Monday, May 24, 1999 2:54 PM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal Hello, >> I wrote routines to parse multipart/form-data contents (file uploads). >> Let's add them to the library. Could you send me the code? Or is it >> updated at contributed units page? >TEZcgi is part of the FCL. It is in CVS or you can get it in the >fcl.zip. The file is ezcgi.pp. So I had it. But trying to create a TEZcgi cgi exits with an "Out of memory" error. A plain CGI with just writeln's works OK. I couldn't track where the error raises, except that it's in the constructor... I think I've read here that there were some problems with TStringList :-?? It's the only "do something" stuff in the constructor, but I can't test it now, I'll wait to the next cvs update. Anyway, I would appreciate if someone can tell me if this problem isn't only mine. My code doesn't touch the constructor, just if you were asking :-) BTW, what does "EZ" stands for in "TEZcgi"? greetings Nico _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…
Nicolas Aragon wrote
I couldn't track where the error raises, except that it's in the constructor... I think I've read here that there were some problems with TStringList :-??

Actually it is a combination of TStringList and AnsiString stuff that is still causing some problems. I think what might be causing this hickup is the GetEnv routine being called. Michael V. modified the code so that it would be platform independent but it appears to give me some trouble. I did a quick get around by commenting out the line

{$I ezcgi.inc}

and then adding dos to the uses line to look like.

uses classes, strings, sysutils, dos;

This was my work around for Linux and I haven't had time to check it on other platforms or even debug it to determine what might the problem with GetEnv. Try this work around and see if it works for you.

It's the only "do something" stuff in the constructor, but I can't test it now, I'll wait to the next cvs update. Anyway, I would appreciate if someone can tell me if this problem isn't only mine.

I believe you are having the same problem I was having.

BTW, what does "EZ" stands for in "TEZcgi"?

EZ - short for "easy"

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael Van Canneyt
to Michael A. Hess: Dos unit FSplit - Splits up the path into path, filename, extension. Linux unit Basename…
Michael A. Hess wrote 15 lines
Cliff Baeseman wrote: > > Do you have anything laying around that can strip a file name from a > path.? Dos unit FSplit - Splits up the path into path, filename, extension. Linux unit Basename - Gives you the filename stripping off the suffix DirName - Gives you the path name stripping off the filename. Be sure to read the documentation for exactly how to use these. :-)

Better yet, use the sysutils unit, like Delphi:

extractfilename
extractfilepath
extractfiledir
extractfileext

These are system independent. Sysutils is, with the exception of some details, 100% implemented. Use that, since it is the same on all platforms.

Michael.

Reply by email

Baeseman, Cliff

I will load delphi link into rational rose today and try a reverse engineer on the rlt and fcl. I can then spit this out to html this might help out a bunch.

Cliff

Earlier message 39 lines
-----Original Message----- From: Michael Van Canneyt Sent: Wednesday, May 26, 1999 9:41 AM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Michael A. Hess wrote: > Michael Van Canneyt wrote: > > > > Better yet, use the sysutils unit, like Delphi: > > > > These are system independent. Sysutils is, with the exception of some > > details, 100% implemented. Use that, since it is the same on all > > platforms. > > Is the next set of documentation going to have some of these types of > things in it? I didn't even realize that these had been implemented yet > and it is tough to go through the code to find what is and isn't there > yet. :-) I've been working on the sysutils docs (and debugging sysutils at the same time) so you can expect it real soon (you more than the rest, prepare your PDF stuff :) ) With already 70+ example programs. As a side note: The docs have evolved to 650+ pages, more than 350 example programs. There are now chapters on using the makefile.fpc and explicit instructions on how to compile the compiler. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Nicolas Aragon
to Paul Gearon: That doesn't work in Australia. Z is pronounced "zed". :o) (we do know about the…

Hello,

I am curious now that you have brought it up. If you pronounce the letter "z" in words as "zeeeee", for example zebra, why do you use "zed"? Just curious about other languages? :-)

We who talk in Spanish see English pronuntiation as a mess.

For us, "a" is always as in "bar", "e" as in "bed", "i" as in "bit", "o" as in "not", "u" as in "bull".

Consonants follow similarly easy rules.

Our language is more "pascalish"... very legible, easy for a lexical scanner :)

greetinz

Nico

Reply by email

Michael A. Hess
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…
Cliff Baeseman wrote
Do you have anything laying around that can strip a file name from a path.?

Dos unit

FSplit - Splits up the path into path, filename, extension.

Linux unit

Basename - Gives you the filename stripping off the suffix DirName - Gives you the path name stripping off the filename.

Be sure to read the documentation for exactly how to use these. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Paul Gearon
You are correct that EZ is a very American slang form but I'm sure that you can find dozens of other software products that use the same 2 letters to represent the same thing.

I'm quite aware of this. Just being a little silly ;-)

I am curious now that you have brought it up. If you pronounce the letter "z" in words as "zeeeee", for example zebra, why do you use "zed"?

I believe that this is the original english form, and is indeed how the english still pronounce it. After all, many letters sound nothing like their name (eg. "W"). At least "Zed" has a "Z" sound in it.

Just curious about other languages? :-)

America changed a lot of things from the original english (Australia changed a couple of things as well, just not nearly as much). Mostly this is spelling. colour <-> color, labour <-> labor, gaol <-> jail, disc <-> disk.

<troll>
I'm often amused to see language options on the net (eg. downloading Netscape) having an option of "English (American)". Does this mean that they acknowledge that the language they are using isn't strictly english, or is it that many Americans don't realise that the language they speak is called "english"?
</troll>

Anyway, back to your scheduled programme (program)...

Regards,
Paul

Paul Gearon

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.
(Translation from latin: "I have a catapult. Give me all the money, or I will fling an enormous rock at your head.")

Reply by email

Michael Van Canneyt
to Baeseman, Cliff: alright that is what I like to here I will change that this evening. I wrote some real…
Cliff wrote 5 lines
alright that is what I like to here I will change that this evening. I wrote some real ugly code to do it last night. BTW is there some routine to give me the path to the currently running application?

!! NO WAY under linux !!
(lest processing the /proc directory tree)

paramstr(0) will ONLY give the ACTUAL command-line command: lazaruside file.pp
will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed.

Michael.

Reply by email

Michael A. Hess
to Baeseman, Cliff: alright that is what I like to here I will change that this evening. I wrote some real…
Cliff wrote 6 lines
alright that is what I like to here I will change that this evening. I wrote some real ugly code to do it last night. BTW is there some routine to give me the path to the currently running application?

Here is what I use but again it uses the Linux unit. I guess there might be something already implemented in sysutils I'll have to look.

+++++++++++++++++++++++++++++++++++++++++++

var
   appPath : string;
begin
   appPath := DirName(FExpand(ParamStr(0)));
   if Length(appPath) > 1 then
      appPath := appPath + '/';    // not root so we need a slash added
.
.
.
.
end;
==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Cliff Baeseman
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…

Michael,

Do you have anything laying around that can strip a file name from a path.?

Cliff

"Michael A. Hess" wrote 23 lines
Nicolas Aragon wrote: > > Now I remember that constructor read also all known variables. Why? > BTW. By loading them in right at the beginning and storing them as Pascal strings it is easier for any of the developers code to deal with them. It also means that they can be accessed again and again without the need to actually access the environment variable. Is this really a big deal? Well no. But it also makes it convient to access any and all valid environment variables via a simple while loop as my little example showed. -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael Van Canneyt
to Michael A. Hess: Is the next set of documentation going to have some of these types of things in it? I…
Michael A. Hess wrote 12 lines
Michael Van Canneyt wrote: > > Better yet, use the sysutils unit, like Delphi: > > These are system independent. Sysutils is, with the exception of some > details, 100% implemented. Use that, since it is the same on all > platforms. Is the next set of documentation going to have some of these types of things in it? I didn't even realize that these had been implemented yet and it is tough to go through the code to find what is and isn't there yet. :-)

I've been working on the sysutils docs (and debugging sysutils at the same time) so you can expect it real soon (you more than the rest, prepare your PDF stuff :) ) With already 70+ example programs.

As a side note:
The docs have evolved to 650+ pages, more than 350 example programs. There are now chapters on using the makefile.fpc and explicit instructions on how to compile the compiler.

Michael.

Reply by email

Michael A. Hess
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…
Nicolas Aragon wrote
Now I remember that constructor read also all known variables. Why? BTW.

By loading them in right at the beginning and storing them as Pascal strings it is easier for any of the developers code to deal with them. It also means that they can be accessed again and again without the need to actually access the environment variable. Is this really a big deal? Well no. But it also makes it convient to access any and all valid environment variables via a simple while loop as my little example showed.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Michael Van Canneyt: I've been working on the sysutils docs (and debugging sysutils at the same time) so you…
Michael Van Canneyt wrote
I've been working on the sysutils docs (and debugging sysutils at the same time) so you can expect it real soon (you more than the rest, prepare your PDF stuff :) ) With already 70+ example programs.

I'm ready. :-)

As a side note: The docs have evolved to 650+ pages, more than 350 example programs. There are now chapters on using the makefile.fpc and explicit instructions on how to compile the compiler.

Way cool! You have been a busy beaver, haven't you? :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Nicolas Aragon
to Baeseman, Cliff: Thanx Michael I would really appreciate that. Cliff -----Original Message----- From:…

Hello,

still causing some problems. I think what might be causing this hickup is the GetEnv routine being called.

But I don't read any... oops! yes, content-length. Now I remember that constructor read also all known variables. Why? BTW.

Show quoted text 7 lines
Michael V. modified the code so that it would be platform independent but it appears to give me some trouble. I did a quick get around by commenting out the line {$I ezcgi.inc} and then adding dos to the uses line to look like. uses classes, strings, sysutils, dos; This was my work around for Linux

OK. I was doing the test under Linux.

with GetEnv. Try this work around and see if it works for you.

I hardly can answer to mail until weekend, but I'll surely try... I still have mail under NT so it takes me a while just to switch. BTW is there a good X client (or well organized in text-mode, like Fido editors) for Linux. I'll surely miss Agent, but it could save me some time.

> appreciate if someone can tell me if this problem isn't only mine. I believe you are having the same problem I was having.

The new code has compiled smoothly, without a complaint. It's been used under Netscape Enterprise Server (nsapi) and MS IIS (isapi), I have a report of working with Windows cgi. And I even ported it to Java, C and some more, so it "should" work :)

> BTW, what does "EZ" stands for in "TEZcgi"? EZ - short for "easy"

Do you know Delphi components to generate html? very "ez" and not difficult to program. But I'll better continue (another day) in private mail, I'm feeling off-topic enough O:)

greetings

Nico

Reply by email

Baeseman, Cliff

So for stuff like ini files we would just place somewhere like /etc hardcoded into the app..? Not very pretty!

Cliff

Earlier message 31 lines
-----Original Message----- From: Michael Van Canneyt Sent: Wednesday, May 26, 1999 10:10 AM To: Subject: RE: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Baeseman, Cliff wrote: > alright that is what I like to here I will change that this evening. I > wrote some real ugly code to do it last night. > > BTW is there some routine to give me the path to the currently running > application? !! NO WAY under linux !! (lest processing the /proc directory tree) paramstr(0) will ONLY give the ACTUAL command-line command: lazaruside file.pp will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Paul Gearon
> BTW, what does "EZ" stands for in "TEZcgi"? EZ - short for "easy"

That doesn't work in Australia. Z is pronounced "zed". :o)

(we do know about the American pronounciation through Sesame Street though ;-)

Regards,
Paul

Paul Gearon

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.
(Translation from latin: "I have a catapult. Give me all the money, or I will fling an enormous rock at your head.")

Reply by email

Michael A. Hess
to Paul Gearon
Paul Gearon wrote 9 lines
>> BTW, what does "EZ" stands for in "TEZcgi"? > >EZ - short for "easy" That doesn't work in Australia. Z is pronounced "zed". :o) (we do know about the American pronounciation through Sesame Street though ;-)

Ahhhh yes. Sesame Street. Cultural exchange at it's finest. ;-)

You are correct that EZ is a very American slang form but I'm sure that you can find dozens of other software products that use the same 2 letters to represent the same thing.

I am curious now that you have brought it up. If you pronounce the letter "z" in words as "zeeeee", for example zebra, why do you use "zed"?

Just curious about other languages? :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

alright that is what I like to here I will change that this evening. I wrote some real ugly code to do it last night.

BTW is there some routine to give me the path to the currently running application?

Cliff

Earlier message 44 lines
-----Original Message----- From: Michael Van Canneyt Sent: Wednesday, May 26, 1999 8:20 AM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Michael A. Hess wrote: > Cliff Baeseman wrote: > > > > Do you have anything laying around that can strip a file name from a > > path.? > > Dos unit > > FSplit - Splits up the path into path, filename, extension. > > Linux unit > > Basename - Gives you the filename stripping off the suffix > DirName - Gives you the path name stripping off the filename. > > Be sure to read the documentation for exactly how to use these. :-) Better yet, use the sysutils unit, like Delphi: extractfilename extractfilepath extractfiledir extractfileext These are system independent. Sysutils is, with the exception of some details, 100% implemented. Use that, since it is the same on all platforms. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Michael Van Canneyt: Better yet, use the sysutils unit, like Delphi: extractfilename extractfilepath…
Michael Van Canneyt wrote 6 lines
Better yet, use the sysutils unit, like Delphi: These are system independent. Sysutils is, with the exception of some details, 100% implemented. Use that, since it is the same on all platforms.

Is the next set of documentation going to have some of these types of things in it? I didn't even realize that these had been implemented yet and it is tough to go through the code to find what is and isn't there yet. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Didier Gasser-Morlay
to Michael Van Canneyt: But this is standard behaviour under Unix for ALL applications. Alternatively, use…
Michael Van Canneyt wrote
On Wed, 26 May 1999, Baeseman, Cliff wrote:

.....

There is a file-hierarchy standard that tells you where an application should put it's files.

Can you tell where to find that information please ?

-------------------------------------------------------------------------------------------- Any views or opinions are solely those of the author and do not necessarily
represent those of Visual Communications Group or its principal operating
divisions (FPG, Telegraph Colour Library, Planet Earth Pictures, Colorific!, Pix, Giraudon, Bavaria Bildagentur).
-------------------------------------------------------------------------------------------- The information transmitted is intended only for the person or entity to which
it is addressed, and may contain confidential and/or privileged material.
If you are not the intended recipient of this message, please do not read,
copy, use or disclose this communication; and please notify the sender immediately. It should be noted that any review, retransmission, dissemination or other use of, or taking action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
--------------------------------------------------------------------------------------------

Reply by email

Michael A. Hess
to Baeseman, Cliff: So for stuff like ini files we would just place somewhere like /etc hardcoded into the…
Cliff wrote
So for stuff like ini files we would just place somewhere like /etc hardcoded into the app..? Not very pretty!

Or you have to setup environment variables like alot of programs do. However requiring that the .ini files be in /etc isn't that tragic it is sort of the standard location for config files.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael Van Canneyt
to Baeseman, Cliff: So for stuff like ini files we would just place somewhere like /etc hardcoded into the…
Cliff wrote
So for stuff like ini files we would just place somewhere like /etc hardcoded into the app..? Not very pretty!

But this is standard behaviour under Unix for ALL applications. Alternatively, use /var/share or so.

There is a file-hierarchy standard that tells you where an application should put it's files.

In any case, it's blasphemy to put a config file in a executable dir. (awful Windows practice)

Michael.

Show quoted text 40 lines
Cliff -----Original Message----- From: Michael Van Canneyt Sent: Wednesday, May 26, 1999 10:10 AM To: Subject: RE: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Baeseman, Cliff wrote: > alright that is what I like to here I will change that this evening. I > wrote some real ugly code to do it last night. > > BTW is there some routine to give me the path to the currently running > application? !! NO WAY under linux !! (lest processing the /proc directory tree) paramstr(0) will ONLY give the ACTUAL command-line command: lazaruside file.pp will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Baeseman, Cliff

I assume you mean lazarus www.pcpros.net/~vbman

Earlier message 24 lines
-----Original Message----- From: Michael Van Canneyt Sent: Thursday, May 27, 1999 7:29 AM To: '' Subject: RE: [lazarus] OT: CGI for apache with free pascal On Thu, 27 May 1999, Andrew Bower wrote: > Stupid question, but can someone give me the project homepage url again, I > lost my link when IE blew up :-/ I don't know the exact URL, but there is a link on http://tfdec1.fys.kuleuven.ac.be/~michael/fpc/links.html Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Andrew Bower

Stupid question, but can someone give me the project homepage url again, I lost my link when IE blew up :-/
Thanks,
Andrew Bower

Earlier message 69 lines
-----Original Message----- From: Michael Van Canneyt Sent: Thursday, May 27, 1999 8:34 AM To: Subject: RE: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Baeseman, Cliff wrote: > So for stuff like ini files we would just place somewhere like /etc > hardcoded into the app..? Not very pretty! But this is standard behaviour under Unix for ALL applications. Alternatively, use /var/share or so. There is a file-hierarchy standard that tells you where an application should put it's files. In any case, it's blasphemy to put a config file in a executable dir. (awful Windows practice) Michael. > > Cliff > > -----Original Message----- > From: Michael Van Canneyt > Sent: Wednesday, May 26, 1999 10:10 AM > To: > Subject: RE: [lazarus] OT: CGI for apache with free pascal > > > > > On Wed, 26 May 1999, Baeseman, Cliff wrote: > > > alright that is what I like to here I will change that this evening. I > > wrote some real ugly code to do it last night. > > > > BTW is there some routine to give me the path to the currently running > > application? > > !! NO WAY under linux !! > (lest processing the /proc directory tree) > > paramstr(0) will ONLY give the ACTUAL command-line command: > lazaruside file.pp > will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. > > > Michael. > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

2 links that are virtually the same.
http://www.lakefield.net/~smiller/lazarus
and
http://www.pcpros.net/~vbman

Shane

>> Andrew Bower 05/27 7:13 AM >>>

Stupid question, but can someone give me the project homepage url again, I lost my link when IE blew up :-/
Thanks,
Andrew Bower

Earlier message 74 lines
-----Original Message----- From: Michael Van Canneyt Sent: Thursday, May 27, 1999 8:34 AM To: Subject: RE: [lazarus] OT: CGI for apache with free pascal On Wed, 26 May 1999, Baeseman, Cliff wrote: > So for stuff like ini files we would just place somewhere like /etc > hardcoded into the app..? Not very pretty! But this is standard behaviour under Unix for ALL applications. Alternatively, use /var/share or so. There is a file-hierarchy standard that tells you where an application should put it's files. In any case, it's blasphemy to put a config file in a executable dir. (awful Windows practice) Michael. > > Cliff > > -----Original Message----- > From: Michael Van Canneyt > Sent: Wednesday, May 26, 1999 10:10 AM > To: > Subject: RE: [lazarus] OT: CGI for apache with free pascal > > > > > On Wed, 26 May 1999, Baeseman, Cliff wrote: > > > alright that is what I like to here I will change that this evening. I > > wrote some real ugly code to do it last night. > > > > BTW is there some routine to give me the path to the currently running > > application? > > !! NO WAY under linux !! > (lest processing the /proc directory tree) > > paramstr(0) will ONLY give the ACTUAL command-line command: > lazaruside file.pp > will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. > > > Michael. > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Michael Van Canneyt: !! NO WAY under linux !! (lest processing the /proc directory tree) paramstr(0) will ONLY…
Michael Van Canneyt wrote
!! NO WAY under linux !! (lest processing the /proc directory tree)

Do you have a clue as to how this COULD be done? I've been looking at the /proc data to determine if the required info is there but I don't see anything. Is this possible at all?

paramstr(0) will ONLY give the ACTUAL command-line command: lazaruside file.pp will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed.

Just to clarify this if the command you key in was

/usr/X11/bin/lazaruside

then that is what will be in paramstr(0)

but if it you key lazaruside and it finds it in the search path

/usr/X11/bin/lazaruside

then yes the only thing in paramstr(0) is

lazaruside

Basically what you type on the commandline is what ends up in paramstr(0).

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

I believe the new kde system monitor shows process item paths? Might have to take a look at
their code to see how its done.

Cliff

Earlier message 47 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, May 26, 1999 7:57 PM To: Subject: Re: [lazarus] OT: CGI for apache with free pascal Michael Van Canneyt wrote: > > !! NO WAY under linux !! > (lest processing the /proc directory tree) Do you have a clue as to how this COULD be done? I've been looking at the /proc data to determine if the required info is there but I don't see anything. Is this possible at all? > paramstr(0) will ONLY give the ACTUAL command-line command: > lazaruside file.pp > will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. Just to clarify this if the command you key in was /usr/X11/bin/lazaruside then that is what will be in paramstr(0) but if it you key lazaruside and it finds it in the search path /usr/X11/bin/lazaruside then yes the only thing in paramstr(0) is lazaruside Basically what you type on the commandline is what ends up in paramstr(0). -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael Van Canneyt
to Michael A. Hess: Do you have a clue as to how this COULD be done? I've been looking at the /proc data to…
Michael A. Hess wrote 8 lines
Michael Van Canneyt wrote: > > !! NO WAY under linux !! > (lest processing the /proc directory tree) Do you have a clue as to how this COULD be done? I've been looking at the /proc data to determine if the required info is there but I don't see anything. Is this possible at all?

The file /proc/PID/exe is a symbolic link to the actual program. How you can extract the filename of this is another matter. (replace PID by the process ID of the program)

Show quoted text 21 lines
> paramstr(0) will ONLY give the ACTUAL command-line command: > lazaruside file.pp > will return lazaruside, EVEN if /usr/X11/bin/lazaruside was executed. Just to clarify this if the command you key in was /usr/X11/bin/lazaruside then that is what will be in paramstr(0) but if it you key lazaruside and it finds it in the search path /usr/X11/bin/lazaruside then yes the only thing in paramstr(0) is lazaruside Basically what you type on the commandline is what ends up in paramstr(0).

This is correct, yes. but only the FIRST thing you typed.

Michael.

Reply by email