delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/08/07/17:18:12

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72D163858433
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1691443091;
bh=vu512a8T8cb0iViFjx9duYQbHyHwVnLtiyXkOGXs/u8=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=vLuQAEsWVP3yT78lk1SNC9yUIIOlxcYMQk1UqpGUjReA76A/0bIEmTRMAh+C7mQvO
4Hlp6qW66NdoaJOKExeD5XRCFrXEDzvxXSXmuKGbqu/TeGsz5OEw5N147c5XKJsVK8
V5ITZq2nrhUCJiXMf0oi4b8fgiej6fWgrIJErUHk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81D733858D37
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20221208; t=1691443075; x=1692047875;
h=content-transfer-encoding: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=EO2WjJTJByIEgV67GNDUvac734h0Ht9oz4To/0ejsxk=;
b=V1XQkdvKa2Ikt2rvU3rXMwIfQCAjbGSNVIWNrdaQsG26MXkkDueOUnr+G2f3Q8lHcp
1uRlGIMiJbMVU1wNVm2Uy2SSGIwmtUlYKceIiCnTtWNgzLafJteDvwooP/qNGCSRNXsf
DW98PoPc6d8ZU334JngDolhPwWMfSsV0NeTdwTZbLxbPd/jX1gPmLnXVH5KBIs7WAUlM
i5jZiHWQ2BhhBU4bqnbt9jvOcg6LdQvyRsBQAxXlksDRxXzDRojGLcod77btuM3RsQnt
04Sv7/wilaBozQl5FplVNOfZ31TWn5p2sjCnmOqNu2rKjHViaqI7a1AIqYnYmCM/TerH
YcIw==
X-Gm-Message-State: AOJu0YyQATCpZdCOc20mudkZPUrKQSVMS8F6DZoBhr9bE2X1MtcJ9KNt
/nbwMHTnip3s10dU7PGAg97pqBctoufkYUfrcj1FxIFV
X-Google-Smtp-Source: AGHT+IEiU3xC8LsJsNSO/x0hPGAQoVypM44jNGABBv35DuQwFD5HZSNelCU8vIjRoKwCls2rMyrb4nVbQWWLvJ+6ScU=
X-Received: by 2002:a05:6870:d1c1:b0:1bf:32bf:1913 with SMTP id
b1-20020a056870d1c100b001bf32bf1913mr14005364oac.43.1691443075590; Mon, 07
Aug 2023 14:17:55 -0700 (PDT)
MIME-Version: 1.0
References: <CANH4o6NwvX30K=X_06vh0w5MYCPgcRXZKJL91aX1UbnWsAJe4Q AT mail DOT gmail DOT com>
<8e62adb7-34b8-2d54-91f5-4f63cfd9d3fe AT Shaw DOT ca>
In-Reply-To: <8e62adb7-34b8-2d54-91f5-4f63cfd9d3fe@Shaw.ca>
Date: Mon, 7 Aug 2023 23:17:44 +0200
Message-ID: <CANH4o6MVbfdQ8uQoS0US1i=Y7zEJ3fkiYdfGaYpYh-De6i5P6A@mail.gmail.com>
Subject: Re: Find free drive letter in Cygwin?
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Martin Wege via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Martin Wege <martin DOT l DOT wege AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 377LICjB011405

On Mon, Aug 7, 2023 at 8:43 PM Brian Inglis <Brian DOT Inglis AT shaw DOT ca> wrote:
>
> On 2023-08-07 10:52, Martin Wege via Cygwin wrote:
> > What is the official cygwin way to find a free drive letter, which can
> > be used in a script to mount a drive?
>
> Just use the Windows UNC network path directly on Cygwin with '/' not '\'.
>
> For Windows, it may still be NET USE * \\... but have not used it in decades!
>
> Cygwin should pick it up and automount it under /proc/cygdrive/?/ but see
> disclaimer above.

So it would be a valid solution in bash to loop from a-z in
/proc/cygdrive/$letter/ and see whether this is a dir, right?

Thanks,
Martin

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019