From nobody Thu Jun 08 18:01:19 2023 X-Original-To: freebsd-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 4QcX8b3bFxz4cDP9 for ; Thu, 8 Jun 2023 18:01:35 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 4QcX8Y4V66z3tdj for ; Thu, 8 Jun 2023 18:01:33 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=q5A3+Mtc; spf=pass (mx1.freebsd.org: domain of aryeh.friedman@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=aryeh.friedman@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-514ab6cb529so4113112a12.1 for ; Thu, 08 Jun 2023 11:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686247292; x=1688839292; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=IlfhocTthZvI5l/rqDGh1mD7cQ0+h8Gsh2WznRU8QBY=; b=q5A3+MtcVC4kSUg1Atnriu4eoKo4v3ubZRPNgTjaK5W/Dksi/2wkIvfPdeD0TikUM0 PfTaHPMDFpmDw0nIaCK2LcIdAVzfqC6R8JNlME7RwythjVqvwTx/6roZOC62hWt+H5s0 gH6WVFJxRr/NMGErnyz4p6KIE9jiqkOyMuh5jmgXbhTYTuVZe5TdeCbVYCZ5uSJ6TOmU qzvYoHPXiNGCqQVeWZEN9iQ0RUsF5IUN/I8Lz5dph25hBzsawbNtEkXyinJTKtoklFC2 apZ6YoGmxpH18f0NJW7oL2/tGyvur/EvEeK0owL9/4eOMtlGhorLf8Q32jbeS5RrKCqN vrfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686247292; x=1688839292; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IlfhocTthZvI5l/rqDGh1mD7cQ0+h8Gsh2WznRU8QBY=; b=at8VYcNpvZhL9iqkRc3uOLEtxR6+tcptK4YbsH7zd/SHPo2rjfHSuUwcV09M1F4BYT KVk2hAe+N71XmO6MfXOzjbyWvB/PNg90MK5XQ4SGLcS+QdKGgM37HdTMwl1bVjoW6lu8 zThUJlN3Zzd5XFu76l0ct1MvfRzGULOjKJ6Vm13zzfwbKVnaELQQzR1c2Q9MzzwxXrtz 2FQwg+xlkiVRXzzXtv7xC0Ah/7zXcLuTN8+gw4muLbV+ixkMcXiQJT6DmrdvVQklMyv2 Qo8AwhcKuYxeOrhTbBiTFhScXtRYfQUizFK7ACKRLRy089h6vWxLEerx1OaVOgEgdteG aZLA== X-Gm-Message-State: AC+VfDxM8g6RsgRqjamXTcAqGKgSsaj5jG2KBHO0BbLTs/VTDjMfShjP UdoETcy7ZsQGOBtPAmQkmjgXz3K7R5jyKakftbBMxqWF X-Google-Smtp-Source: ACHHUZ7CyDBOYa0XKjYHbCtjd6WNAJGlgXj1ByVIw5pTNBNnh8lqPSm64GVBkHXQkIxz1JrcfNFGWz5+oho9NXup2IU= X-Received: by 2002:a17:906:4788:b0:977:d27e:dd5f with SMTP id cw8-20020a170906478800b00977d27edd5fmr350221ejc.28.1686247291459; Thu, 08 Jun 2023 11:01:31 -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 From: Aryeh Friedman Date: Thu, 8 Jun 2023 14:01:19 -0400 Message-ID: Subject: Slightly OT: non-buffered stdin in Java To: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-3.23 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992]; NEURAL_HAM_LONG(-0.85)[-0.852]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.38)[-0.385]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::52a:server fail]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52a:from]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; TO_DN_ALL(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QcX8Y4V66z3tdj X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N 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 -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org