From nobody Thu Jun 08 21:22:38 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qcccr273Pz4bZ3s for ; Thu, 8 Jun 2023 21:22:52 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qcccq6v4lz4P4H for ; Thu, 8 Jun 2023 21:22:51 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-977cc662f62so167379566b.3 for ; Thu, 08 Jun 2023 14:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686259370; x=1688851370; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QAx7XxMJamvaMuf12fphgVXJXd8GkHZms9lubcyz0v4=; b=rku26DhurytuMu1xdd26T2/z4tCjU7BW2fhmMwMA2Kq1TlLt/gdvnti+Xo9XsR42Kn llQs2DNsC4bykQSfqplhlMBK+Peto6+a8QCs6Q+pCTzQSa7Q5vXrbmeovhPG7ALy7lyL xMWabXUcA7uS8QY+aXANK4twOIzM8vAqZKyz2mH2honitxx5z0MdIah34JLjIV4575Pc x1+K0xfXuBxU5h3//dbskIVuIC/jmCo26/6UEtHXnRYEw4pdxMissCtYwrnqJQLSBfck sZXOfc6WV/btCi8FLcxOhFdpjdFPc/Pscz8nIUS5Zl4ofGMFW9wWes0SwY7Y/X9actfF HXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686259370; x=1688851370; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QAx7XxMJamvaMuf12fphgVXJXd8GkHZms9lubcyz0v4=; b=K+aaSoLy4PELs17+Hxs4HFyC8ehBhirP1zc8IcPQ3jI1UMfwDyri7AsmX6rohXGubu wFhC/x93f3WHzgf/z0tGJIGgldOvBX9D9sUrA4Kvhlyqa7VbeJuszCfEg0HxDTdJjRNz 5dzCY55umUtA7fz1bcH/IZmTvZprpWiPA0yh76xmF90QcBtuWCnbQ3cGiA0vYuiuPOhF K6ax8fzjsq2JOHViB4iQ4p9QOCrJ3xuh72PX2OactbXEEXhqsopA4m1zsANkhRu4yZ9V K/fTUmEy/myLDAaTaJEr7fSmv9k+Nkub4Xj8WgEj2DAg/vrMcCQBrT9eFRwk5rkiA0Le vDLA== X-Gm-Message-State: AC+VfDwS9/pJe/XJyUFArLVcoVX1oRzB6tPWyY4j47eLBqcjSMIY9MuR BTMElxExKBxF/zPpdasG7oJ1wKhC0vxDQTAvBBtVHzqr X-Google-Smtp-Source: ACHHUZ4FJfvz7YTmw5hVS8cmFrCPYxJV7U065NpiGC2s8I4HSZUxUS7MDYawGTf2ZRHDXaBupT20jFLlJFJiQCdfPdY= X-Received: by 2002:a17:906:dc92:b0:974:1c90:a097 with SMTP id cs18-20020a170906dc9200b009741c90a097mr363754ejc.12.1686259370418; Thu, 08 Jun 2023 14:22:50 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <202306082039.36831.dr.klepp@gmx.at> In-Reply-To: <202306082039.36831.dr.klepp@gmx.at> From: Aryeh Friedman Date: Thu, 8 Jun 2023 17:22:38 -0400 Message-ID: Subject: Re: Slightly OT: non-buffered stdin in Java To: "Dr. Nikolaus Klepp" Cc: questions@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Qcccq6v4lz4P4H X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, Jun 8, 2023 at 2:39=E2=80=AFPM Dr. Nikolaus Klepp = wrote: > > Anno domini 2023 Thu, 8 Jun 14:01:19 -0400 > Aryeh Friedman scripsit: > > Under Java stdin (System.in) is a buffered stream not sent to the > > application until return is pressed. But, Java can read from > > files/sockets and other generic InputStreams unbuffered. So I was > > wondering if there is a command that will make stdin go to a file so > > that Java can open that file and read it unbuffered? > > > > I know I can do something like cat ->file but that makes it hard to > > sync stdout and stderr (both are unbuffered in Java) with the file > > version of stdin > > > > "stdbuf" might be what you look for: > > https://man.freebsd.org/cgi/man.cgi?query=3Dstdbuf Will likely need to play with it more but stdbuf -i 0 -o 0 cat -|cat didn't produce the expected immediate echo I still had to hit return --=20 Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org