Find free drive letter in Cygwin?
Andrey Repin
anrdaemon@yandex.ru
Mon Nov 6 17:30:56 GMT 2023
Greetings, Martin Wege!
> On Mon, Aug 7, 2023 at 8:43 PM Brian Inglis <Brian.Inglis@shaw.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?
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...
More information about the Cygwin
mailing list