Recent

Author Topic: Help finding a file in my Linux FPC/Lazarus system  (Read 848 times)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 565
Help finding a file in my Linux FPC/Lazarus system
« on: July 17, 2024, 05:15:13 pm »
I've been exploring the FPC docs and came across an article on the "AssignPipe" function on page 2065 of RTL.pdf.  This article includes an example program demonstrating the use of the function, and shows that the listing for the program is at ./unixex/ex36.pp . (The demo program is listed there in the article, so having the file isn't critical to trying the code.)

Still, I've hunted everywhere I can think of for this file on my installation of FPC/Lazarus, with no luck in finding ex36.pp.  Can anyone tell me where I need to look? I don't doubt that the file is there somewhere -- and I'd like to look at the other examples.

Thanks for any help.  I'm lost in the files.

440bx

  • Hero Member
  • *****
  • Posts: 4742
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #1 on: July 17, 2024, 05:24:54 pm »
I don't know if it is present in your installation or not but, just in case it is not installed, you can find it at (along with more examples):

https://github.com/svn2github/freepascal_docs/blob/master/bunixex/ex36.pp

HTH.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8035
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #2 on: July 17, 2024, 05:31:16 pm »
Code: Text  [Select][+][-]
  1. $ locate ex36.pp
  2.  

or alternatively

Code: Text  [Select][+][-]
  1. $ find /usr -type f -name ex36.pp
  2.  

I can't remember for sure, locate might be an optional program which has to be installed... if it's there though it will be efficient since it relies on a backend database. You'll always find find on a system, but it's a brute-force search which can be thrown by things like inaccessible directories or "specials" in /proc or /sys.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 16193
  • Censorship about opinions does not belong here.
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #3 on: July 17, 2024, 05:46:51 pm »
The examples - for the manuals - need to be downloaded separately and are not installed by default (for fpc, dunno about lazarus)
Usually the examples are always compilable examples and belong to the docs tree.
So copy paste will work.
If I smell bad code it usually is bad code and that includes my own code.

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 565
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #4 on: July 17, 2024, 05:51:06 pm »
Thank you very much 440bx.  No, none of this was included in my FPC/Lazarus installation (done with fpcupdeluxe) or in any of the links to FPC documentation that I've encountered.  Downloaded the .zip though and will add it to my "FPC Documentation 2021" folder.  (In a quick scan, I noticed that some of the examples are 19 years old!)

I tried locate ex36.pp  MarkMLI, and it turned up nothing on my system. For historical reasons I don't take that as proof that stuff isn't there though, and usually assume I've screwed up something up somehow, like accidentally renaming a directory in my wandering around.

It would be nice to have an introduction to the FPC/Lazarus file structures somewhere.  I'll bet such a thing is available and I just don't know how to find it...

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 565
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #5 on: July 17, 2024, 06:00:48 pm »
The examples - for the manuals - need to be downloaded separately and are not installed by default (for fpc, dunno about lazarus)
Usually the examples are always compilable examples and belong to the docs tree.
So copy paste will work.

I understand, and it was no problem to copy the example from the article and try it out.  It was more a matter of wondering what I was missing:  FOMO I guess  :)

Maybe in the next revision of the RTL docs, a note about how to get the examples would be useful?  (Or maybe that note is there and I just didn't see it?).

440bx

  • Hero Member
  • *****
  • Posts: 4742
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #6 on: July 17, 2024, 06:23:09 pm »
Thank you very much 440bx. 
You're welcome.  I'm pleased that was helpful.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Fred vS

  • Hero Member
  • *****
  • Posts: 3414
    • StrumPract is the musicians best friend
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #7 on: July 17, 2024, 06:32:28 pm »
I tried locate ex36.pp  MarkMLI, and it turned up nothing on my system.

Hello.

You need to do first:
Code: Pascal  [Select][+][-]
  1. $ sudo updatedb
then
Code: Pascal  [Select][+][-]
  1.  $ locate ex36.pp

It is the reason why I prefer to use second option of Mark:
Code: Pascal  [Select][+][-]
  1. $ find /usr/ -name ex36.pp

And you may use also wildchar *
Code: Pascal  [Select][+][-]
  1. $ find /usr/ -name ex36.*
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Thaddy

  • Hero Member
  • *****
  • Posts: 16193
  • Censorship about opinions does not belong here.
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #8 on: July 17, 2024, 06:39:28 pm »
@440bx
 I am sorry I missed your correct answer. All examples are in the docs tree.
 
If I smell bad code it usually is bad code and that includes my own code.

dsiders

  • Hero Member
  • *****
  • Posts: 1282
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #9 on: July 17, 2024, 07:22:30 pm »
@440bx
 I am sorry I missed your correct answer. All examples are in the docs tree.

Just to be clear... the doc tree is a separate repository located at:

https://gitlab.com/freepascal.org/fpc/documentation.git
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

440bx

  • Hero Member
  • *****
  • Posts: 4742
Re: Help finding a file in my Linux FPC/Lazarus system
« Reply #10 on: July 17, 2024, 07:25:41 pm »
@440bx
 I am sorry I missed your correct answer. All examples are in the docs tree.
No problem.  I normally don't answer anything that is Linux related but, I figured I'd post that link just in case it might be useful.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018