From nobody Thu Jun 08 18:39:36 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 4QcY0X5sb4z4cKMt for ; Thu, 8 Jun 2023 18:39:40 +0000 (UTC) (envelope-from dr.klepp@gmx.at) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcY0W0Zq3z43VL for ; Thu, 8 Jun 2023 18:39:38 +0000 (UTC) (envelope-from dr.klepp@gmx.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.at header.s=s31663417 header.b=LwjfCmRi; spf=pass (mx1.freebsd.org: domain of dr.klepp@gmx.at designates 212.227.17.22 as permitted sender) smtp.mailfrom=dr.klepp@gmx.at; dmarc=pass (policy=none) header.from=gmx.at DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1686249577; x=1686854377; i=dr.klepp@gmx.at; bh=BSorQkVQkFUZDGsoHzW2SI+JvnviK/InYU18J1wMn5s=; h=X-UI-Sender-Class:From:To:Subject:Date:References:In-Reply-To; b=LwjfCmRiMXbqDBeL1dM5qa/umMr3WIpkXHXdHPBZSo7vgmeXqM0zXPTx+cyKoFK7VgDzOVs Rp7RJid7r5060fjmvU1LCMTKQ2kpbibdvsawt+5hZFKgot/l8DdVQSUUnoAmGsMEKJVBFDUWX fFqQ/q20cUuf5e8PxIBTuY7rl1N5Rfl+EIeTGD8leg0I6KKTm48tnZIw3MwyuIKBppRWK+VyW hyeAyZnujxrneFiecqa/l5rQQugd+FYY3vFsx4Rw3XRL3P88140DL1vT/38975C6OcfEMD/jt +07iVPl94vXOVHKgS58O72H9Nl82L2lBG6bwCStnmG2WpzAbV+6w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from neo.lan ([78.142.103.142]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmDIu-1ph2Gf1F1k-00iBs0 for ; Thu, 08 Jun 2023 20:39:37 +0200 From: "Dr. Nikolaus Klepp" To: questions@freebsd.org Subject: Re: Slightly OT: non-buffered stdin in Java Date: Thu, 8 Jun 2023 20:39:36 +0200 User-Agent: KMail/1.9.10 References: In-Reply-To: X-KMail-QuotePrefix: > 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 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <202306082039.36831.dr.klepp@gmx.at> X-Provags-ID: V03:K1:ELDnxDXaftGAG56TmuQ7+xt0ilvhLAZbXsC8u0nl+TjGqchFTwc wRuZgykaA1GUaRCoNZLd4PEtsOURwwNwhjjY2z6mTebl1YOU/3smOszK+THchSYNjBGaa14 ab3D8j3DqdtMJ/c2m9oxqI2oZ07nwp9MRv+Os+ZSdwA9jxH1a6RNC/0fRejRInqFs+qYNXG YUGAXRfKr0mbL9N7d1HYQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YUjb+NxrmHo=;6CAqks5YZH0f8+vDsh9lQ6Mb+li pY0kNc+XnaCbDxZTG03fadUZEF0iA5HS6Y1nY45x0YnbUOFsgZ7Ny8CWifm1GM0yr6BnbxU2C aZoRna+Dk2a2TN3E1/QUE+DFYQ1l+xqY3i6KAh2DHY4IdRgmIflcbRgGWnAAFjQd6TKuQcnC6 HPSbcWAVhrmRaXF8AwRb5e/8VCBNBI7ujg7UyavDXotatESpe/lP46sY82HP6hRpE5uQ9CUUa t4KEyocVNb8StiLet1uWwwsqGHZwpaJY5OAXB/zVs/Ka/82J6f7oOgvfwMUK0MCMI1q+gP1i8 UaJBGcEF31AeblRBQjp3JtV/cCfjX3IkQ6DBS3/Ulx7AcxmXtOySJpIz0C9Z/jmaEHJFSxD7Q 2k9JUHZtdcUcGrLqv3aN82WefRM9VxtzyjcRJyP6RzzS4V+z6XBEiZ64/iONfGxuEk3F9FeUO w1S5SnvgkKg0puE1RdhZ7xT2pYvMUFFYmbf1gQNuftNMxusIlNQUwY8j4iLuToMFN6wxmIlkd lp5bHBGeeZnL+Bgy8XV28cgPFK0wGriopp8i2ynZJM9SrMsJPZgJQbcWFCIhIaKrQRro5aULw kyaUQNNxfBiftwWefRlzHdYzAsFk5aEWF4poDOeVqW142h7nINSijK1L0GVVTn/xocuupn0JS Cxi9L0UW2tAK6v2Z4gB8sIQq3KyC12DyMj73VkvaW74O+Y3a/uQU7lg2uu5Wkx0FtgLPC3dBy NwbLHsbPn8lVmUxCYjvDqkUnPoGg8pImT+apaadyHmSIU5D/ApWXNuA5BC/cJA++zxTMr6ckE pNPhyxzz5EktVhKc0WwSguHc8tpqFdbuBHhgaOBMOk24gNyUq9qBAq0D/U5sR0goWxZO1+WnP fvMPmxaxy+UIb7I/z9sF8XMiq8681WLFyZ2UUEvp66FNs/Y1cBmW7Mdg/3z2haS9nLVMW+uQo 7Kue9hVeQww3oOHO8rZSV7mtDqU= X-Spamd-Result: default: False [-1.22 / 15.00]; MID_CONTAINS_FROM(1.00)[]; FROM_NAME_HAS_TITLE(1.00)[dr]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_LONG(-0.87)[-0.872]; DMARC_POLICY_ALLOW(-0.50)[gmx.at,none]; R_SPF_ALLOW(-0.20)[+ip4:212.227.17.0/27]; RWL_MAILSPIKE_VERYGOOD(-0.20)[212.227.17.22:from]; R_DKIM_ALLOW(-0.20)[gmx.at:s=s31663417]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.17.22:from]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_SHORT(-0.05)[-0.045]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; BLOCKLISTDE_FAIL(0.00)[78.142.103.142:server fail]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[gmx.at:+]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[gmx.at]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmx.at]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4QcY0W0Zq3z43VL X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N 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 Nik =2D- Please do not email me anything that you are not comfortable also sharing = with the NSA, CIA ...