[fpc-pascal] sysutils.beep doesn't beep under Linux?

Michael Van Canneyt michael at freepascal.org
Fri Nov 20 13:56:11 CET 2009

On Fri, 20 Nov 2009, Graeme Geldenhuys wrote:

> Michael Van Canneyt wrote:
>> No, the application can (for instance almost all daemons do) close
>> stdout. Programs that use ncurses will also be messed-up.
> Ah, ok.
>> For CGI programs, stdout is also reserved for the HTML output.
>> Imagine someone else's code doing a beep, and it ends up in your HTML
> I can't say I have ever seen a HTML page that beeps, but then again you
> never know. ;-)
>> If you'll remember, tiOPF had some very common (but nasty)
>> windows-only constructs like showing message boxes deeply buried in
>> core functionality. Works fine. Till I come along and want to run the
>> thing on Linux. Bummer...
> Please let me know if this is still the case, so those + translations
> can be resolved. It took me considerable time to fix tiOPF Core to run
> on a headless Linux box. So if any strange "gui" message boxes appear in
> tiOPF Core, I would be very surprised. Hard-coded English text is a
> different issue.

As far as I know, they were removed at the first "complaint" from my side,
but I just wanted to make a point, namely: you don't know what system your
code will end up on.

>> By that rationale: no beep() on linux.
> Funny you say that. When I started working on fpGUI's DocView (help
> viewer) and viewed various OS/2 INF files, I couldn't get the damn
> program to stop beeping at me! It took me a good two weeks before I
> found the problem - it was #7 characters used in the IBM INF documents!
> So I can honestly say my Linux system CAN beep. ;-)

It can, of course...

> Possible alternatives:
> Maybe under Linux the system.beep() can make a sound if stdout is
> available, otherwise write the word "beep" to the console (like the old
> silent movies did on screen), or flash the Scroll Lock keyboard light. :-)

No, see the ncurses/cgi use cases.


More information about the fpc-pascal mailing list