DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4B9CnGt7810076 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4B9CnGt7810076 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=lhdC9WtK X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E52533858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1733748554; bh=xtlS95pIokd0dBJIAP/6uuxYbXVFsLpXQTPhiA/PF8c=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=lhdC9WtK9jTrZvaQIxY4KVNr9NIKtn0UYTFVF5kz6TMUpOR1Iw3zyicIz8ylPZKQn QkeaaIwjad2KNztsEDNNUQrU9lPi0QFnZvv7viXjtQSiuNE4RnN5Ae9RvLGt4gDxbl O4fw4e8LmAvRi6SurpQARLiVvHOrssqx9OYw8fAQ= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6E033858D34 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6E033858D34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733748481; cv=none; b=BZaLKfbpaRINyRK1tFOfcQcRaAkTEnVOVOWP01tYjgBHpJPMwqlDKi2vRFlVlrQR47tde9ShxcvmV7KvdZ4XdJaoD2qH1vCAU1VrodWsN7pSGVMbQaITu0udiLnJGYMgPWnD2lRrAh65h2ZwIW7xBRxl7aqL+ya+7+ccvpzcH2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733748481; c=relaxed/simple; bh=PpTwywGtU30mecax9ezHj7Oq9sR2gMSuvZqtfv7Oo/o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=pz0p460SOyiQQy0FOBO1Mp2RnORKaX5++GDA+WwBtZr7FvIEthaH+j/aDUkcuxPHruihlU5ZMBYgS11XzOTsdEkbro0USDO1+yToBIwBxeDZrvhL+0Ih8FIyRlB/sDwE8DXhOarOUIfVa3ihLgMbhFsfyutkhWgmlYqiINs+1Hw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6E033858D34 Message-ID: <053d21b3-ee11-4858-a60d-54cd154fd98c@kircheis.it> Date: Mon, 9 Dec 2024 13:47:56 +0100 MIME-Version: 1.0 Subject: Re: cygpath and unc paths To: cygwin AT cygwin DOT com References: In-Reply-To: X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Federico Kircheis via Cygwin Reply-To: Federico Kircheis Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Cygwin" On 09/12/2024 12.46, Corinna Vinschen via Cygwin wrote: > On Dec 6 13:23, Federico Kircheis via Cygwin wrote: >> Hello, >> >> was it considered to add a flag to cygpath to output a path in unc format? > > No. But it wouldn't be much work. It would be very nice if it ever happens. >> For example, the folder >> >> C:\test. >> >> cannot be accessed from many Windows applications (powershell and cmd >> included) because of the trailing dot, while cygwin has no issue creating, >> accessing and deleting such files/folders. >> >> Using an unc path >> >> \\?\C:\test. >> >> solves the issue for some programs, but cygpath currently misses an option >> for creating such path. > > As a workaround you can just prepend the long path prefix: > > echo -n '\\?\'; cygpath ... Which is what I'm doing, plus special-casing 1) root path, like C:\ , because for whatever reason \\?\C:\ is not valid, it has to be a subfolder (and trying to trick it with \\?\C:\\ does not work either). 2) unmounted network drives (\\server\path) I'm not sure how a --unc should handle those cases. For all things I have in mind, not appending \\?\ is preferred, but someone might expect a hard error. Either way, it is another reason why it makes sense for cygpath to handle those cases, currently I have to parse it's output before prepending '\\?\'. >> Notice that creating a dos path leads to an error. > > I don't understand. Creating which DOS path with which application? I meant that it is not possible to create a DOS path to C:\test., thus using a dos path is not a viable workaround to unc: ---- > cd 'C:/test.' > cygpath -ws . cygpath: cannot create short name of . ---- -- 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