[LINUX] RunProgram(#PB_Program_Read) erste Zeile fehlt

Hier werden, insbesondere in den Beta-Phasen, Bugmeldungen gepostet. Das offizielle BugForum ist allerdings hier.
Benutzeravatar
Makke
Beiträge: 156
Registriert: 24.08.2011 18:00
Computerausstattung: AMD Ryzen 7 5700X - AMD Radeon RX 6800 XT - 32 GB DDR4 SDRAM
Wohnort: Ruhrpott
Kontaktdaten:

[LINUX] RunProgram(#PB_Program_Read) erste Zeile fehlt

Beitrag von Makke »

Hallo,

bei dem Befehl RunProgram mit dem Schalter #PB_Program_Read wird unter Linux (Ubuntu 16.04 LTS 64-bit) die erste Zeile nicht ausgegeben. PureBasic v 5.42 LTS.

Beispielcode:

Code: Alles auswählen

Compiler = RunProgram(#PB_Compiler_Home+"/compilers/pbcompiler", "-?", "", #PB_Program_Open | #PB_Program_Read)
  Output$ = ""
  If Compiler
    While ProgramRunning(Compiler)
      If AvailableProgramOutput(Compiler)
        Output$ + ReadProgramString(Compiler) + Chr(13)
      EndIf
    Wend
    Output$ + Chr(13) + Chr(13)
    Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
    
    CloseProgram(Compiler)
  EndIf
  
  MessageRequester("Output", Output$)
Erste Zeile sollte sein: PBCompiler "Filename"

Die fehlt aber. Das Problem ist mir beispielsweise beim Programm mp3gain aufgefallen.

Code: Alles auswählen

    PB-Version: PureBasic 5.42 LTS (Linux - x64)
    OS: Xubuntu 16.04 LTS 64-bit
    Compilereinstellungen:
        [x] Unicode-Executable erstellen
        [ ] Thread-sicheres Executable erstellen
        [ ] OnError-Unterstützung einschalten
        [x] Moderne Themen-Unterstützung aktivieren (für Windows XP und höher)
        [ ] Administrator-Modus für Windows Vista und höher anfordern
        [ ] User-Modus für Windows Vista und höher anfordern (keine Virtualisierung)
        Library Subsystem: ---
Zuletzt geändert von Makke am 23.08.2016 12:12, insgesamt 1-mal geändert.
---
Windows 11 (64 bit)
Omi
Beiträge: 143
Registriert: 25.03.2013 09:59

Re: [LINUX] RunProgram(#PB_Program_Read) erste Zeile fehlt

Beitrag von Omi »

Hallo Makke,
hättest Du die 2 Zeilen über Deinem Beispielcode auch mit herein kopiert, wäre die Antwort gleich dabeigewesen. :wink:
; Für Linux/MacOS ändern Sie das "/?" in "-h".
;
Sodann erscheint überhaupt erst der ganze Output - inklusive ...
USAGE: pbcompiler <sourcefile>
Grüße, Charly
PureBasic Linux-API-Library: http://www.chabba.de
Benutzeravatar
Makke
Beiträge: 156
Registriert: 24.08.2011 18:00
Computerausstattung: AMD Ryzen 7 5700X - AMD Radeon RX 6800 XT - 32 GB DDR4 SDRAM
Wohnort: Ruhrpott
Kontaktdaten:

Re: [LINUX] RunProgram(#PB_Program_Read) erste Zeile fehlt

Beitrag von Makke »

Leider nein,

ich sagte nicht das gar nichts kommt, sondern das die erste zeile nicht dargestellt wird.

Ändere den Beispielcode.
---
Windows 11 (64 bit)
Omi
Beiträge: 143
Registriert: 25.03.2013 09:59

Re: [LINUX] RunProgram(#PB_Program_Read) erste Zeile fehlt

Beitrag von Omi »

Hallo Makke,
ich zweifle weiterhin dran 8) .
Die Aufrufe aus PureBasic (entsprechend Deines Beispiels) liefern die selben Ergebnisse wie aus dem Terminal mit (auf meiner Installation) "/home/charly/Programming/PB5.42/compilers/pbcompiler parameter"...

Bei Parameter -? (nicht vorhanden)
Unknown switch: -?
pbcompiler -h for help.
Bei Parameter /? (nicht vorhanden)
******************************************
PureBasic 5.42 LTS (Linux - x86)
******************************************

Loading external modules...
Error: File not found (/?).
Bei Parameter -h
USAGE: pbcompiler <sourcefile>

OPTIONS:
-c, --commented Produce commented asm output (purebasic.asm)
-d, --debugger Enable debugger
-u, --unicode Enable unicode support
-t, --thread Enable threadsafe support
-e, --executable <file> Create executable to <file>
-i, --import <file> Create import file to <file>
-r, --resident <file> Create resident file to <file>
-ir, --ignoreresident <file>
Ignore the given resident <file>
-q, --quiet Display only error on the standard output
-sb, --standby Starts compiler in standby mode (remote control)
-pf, --purifier Enable purifier
-ls, --liststructures Creates a file with all the structures
-lf, --listfunctions Creates a file with all the functions
-li, --listinterfaces Creates a file with all the interfaces
-lp, --listpath Set the output path for the above lists commands
-qs, --querystructure <name>
Creates a file with the definition
-s, --subsystem <name> Uses the specified subsystem
-so, --sharedobject <file>
Create a dynamic library (shared object)
-dc, --dynamiccpu Create a executable with all processor specific routines
-mmx, -3dnow, -sse, -sse2
Create a processor specific executable
-l, --linenumbering Enable line numbering support for OnError
-o, --constant Name=Value
Declare a new constant at compile time
-g, --language Set the language of the compiler error messages
-ds, --debugsymbols Add standard debug symbols to executable
-k, --check Check the syntax only, doesn't create/launch the executable
-pp, --preprocess <file>
Creates a single file with all macros expanded and all sources files included
-v, --version Display the compiler version
Also noch erstere Zeile konnte ich nicht entdecken.

Grüße Charly
PureBasic Linux-API-Library: http://www.chabba.de
Antworten