X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03A093858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1699291918; bh=2tHmNZSqfBqf8qWSQMcV8xqAa6gDqr3lmWZ4/BOPdVY=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=H8EuRESphLeTqm6Sg7+eZtjhoJTGoVbpREQ2S6Dw4XdvHqucifExP57h46FpwWdzo odexJOLZZf/d9N1d2kRDwqUussd7IqQo8YRGBUSloVqAryldvkapiLIvkrcFkl6OC0 Y83zFEBtl0DcnVp4+tEF1GVX4BTEJrxtbf7XeagY= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43039385840E ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43039385840E ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699291856; cv=none; b=sbO6JGSuPy7RnhixYzLi+7AnOgrSrpvpiZBuoSCxungiARm5/lhkMU07nA5+fdK8x1plvtyZDWOmBrLQR0b79wwwpLTkeTVZ3W1aKSNif6cRbi2XXoGKNT6FWuKmVDmBDqF12oiR/RCAfGbstFLsD+jAK5a47cW/8UL8S/bRl+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699291856; c=relaxed/simple; bh=I7mfiqyPUsFhweWRrXGxqxDEM67BobHq01OGEotqHWI=; h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version; b=nqAk3kpiUM8STm0V87DkPfrDQgaCt+G7Me8QAOe3appA0OZvxI3049EGtXO9KA4yD7CmTq9MVfFBMVxPC+/p5ujPQZLylGwFKINUhwU82oAjFdTVlDFTxHoa1fUZhWkNuLRP45X9ESmT7V9x9Kd7uUMIhfYnc/OVJ8AofxGNAC4= ARC-Authentication-Results: i=1; server2.sourceware.org X-Yandex-Fwd: 1 Date: Fri, 15 Sep 2023 16:00:00 +0300 X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <517345390.20230915160000@yandex.ru> To: Martin Wege , cygwin AT cygwin DOT com Subject: Re: Find free drive letter in Cygwin? In-Reply-To: References: <8e62adb7-34b8-2d54-91f5-4f63cfd9d3fe AT Shaw DOT ca> MIME-Version: 1.0 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrey Repin via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Andrey Repin Content-Type: text/plain; charset="utf-8" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3A6HW9MW009501 Greetings, Martin Wege! > On Mon, Aug 7, 2023 at 8:43 PM Brian Inglis 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? If you want a temporary bind, A: and B: are often free on modern systems. Or you could just make a junction to a directory instead. mklink /J $( cygdrive -aw $(mktemp …) ) \\server\share -- With best regards, Andrey Repin Friday, September 15, 2023 15:57:10 Sorry for my terrible english... -- 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