Author Topic: Pipecom - Cross-platform Alternative to Shell by SpriggsySpriggs  (Read 656 times)

0 Members and 1 Guest are viewing this topic.

Offline Junior Librarian

  • Moderator
  • Newbie
  • Posts: 16
Pipecom - Cross-platform Alternative to Shell

Author: @SpriggsySpriggs
Source: qb64.org Forum
URL:https://www.qb64.org/forum/index.php?topic=3641.msg129938#msg129938
Version: Visit author's URL
Tags: [OS information]

Description:
pipecom is a cross-platform utility for directly obtaining console output in Windows, Mac, and Linux. Previously, one would need to use files.

There are 2 versions.

Basic usage for returning back console output as a string only:
Code: QB64: [Select]
  1. MyOSInquiry$ = pipecom_lite("OS line command")
As expected from "lite", this just returns the answer as a string.

Usage for returning back stdout, stderr, and exit codes:
Code: QB64: [Select]
  1. Dim As Long exit_code
  2. Dim As String stdout, stderrexit_code = pipecom("dir /b *.bas", stdout, stderr)
  3. 'print or manipulate values as you see fit


Note: Code posted here would be redundant and not up-to-date .  The author is continuously making updates for improvement.  Go to the URL above.
« Last Edit: September 25, 2021, 06:22:50 AM by Junior Librarian »