delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/11/07/04:35:31

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A88DA385842A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1667813693;
bh=Fpv+utNb1PkWz+slgQHqpPdAiITrCcQ8gs+s/zqFUoE=;
h=Date:From:To:Subject:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
Reply-To:From;
b=cf6ZwvJbpdoXeKP+ZssJnZbcZ4mqRJqSpCe0CLFxd9MGQr67xzSjq2PDFvOku7Ekf
2vCp3rAAJTJhWRB5iS5QZn65mFbfp2xhTdOuePiWK3DyPXW12XVU69kZLvee7sFyRd
gQ96O1s3MCcX3+F14HGNIT/BgkYzBKE/gJjPp5rY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2DBDD3858409
Authentication-Results: sourceware.org;
dmarc=fail (p=none dis=none) header.from=cygwin.com
Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com
Date: Mon, 7 Nov 2022 10:33:25 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Accessing long filesystem paths using Python
Message-ID: <Y2jQ5aAlgKuNreVG@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <AM6PR08MB4421EE65314E815E8BA73753E63B9 AT AM6PR08MB4421 DOT eurprd08 DOT prod DOT outlook DOT com>
<AM6PR08MB4421530580BFE77F7508D890E63B9 AT AM6PR08MB4421 DOT eurprd08 DOT prod DOT outlook DOT com>
<CAB8Xom_kn8VZm29ot251=85fp5m-O8y0kn3jL3rHObmXbKGZRA AT mail DOT gmail DOT com>
<AM6PR08MB44210F777A836F5E5A5FF507E63B9 AT AM6PR08MB4421 DOT eurprd08 DOT prod DOT outlook DOT com>
MIME-Version: 1.0
In-Reply-To: <AM6PR08MB44210F777A836F5E5A5FF507E63B9@AM6PR08MB4421.eurprd08.prod.outlook.com>
X-Provags-ID: V03:K1:+9xpZwQOPFWmcI30/YnfaexwoVdh1pXuaJeEDB/1NbysygW+nDE
msqlFDYdVV6e/eUCMW9LCLDwS3lyFHG1Q1HXKhlGruuEScHaJGLehVcWczTlqkZnMd55fVM
wrdKyY1jATHn4bB8leAGqNAQTZKDyIE1rjP+Uld4MAi6ZRmLRX1OYH16Ia9lyhNfoFAjqN9
OU7/E8zDoTRe6/yDtG7+w==
X-UI-Out-Filterresults: notjunk:1;V03:K0:ZF2KJ5rME1Y=:rSL+Cgac2LkgMXch5lYk/X
mXWb4zj+TqC1weTwg6IgKqrevBmsZ3R13VLagsx2pbJz/c6UgdbZrGmGp1jzdBUnQ/O2wndBy
JdEa0V1ijGBeWL2rvzu63XyKwbDSCQjEwHRrgc9D9UgvJ9MFwErp2VIinDRvh98BxZSftEGyU
+0ojqb+3z/pJ0TqwShDokk7cyRnd4pI5mgC0Tf3q8pykgya+ptuyAdcp4Gg0cjcMypJQCfolQ
6bEB7sCDoSw9RVfT77l2vC0rYI9dYayzJF/bUzDWQUndbvFsQDuf0qJ5ule6jDI1C3W4813ZY
i4m8ubvl84XiEfAmweoSAOLmmKr/7rsuxpFYJJWIghvjsceclCYb8M028mazF26n8nwyM32mr
TIJAFEIoviZtNbqKoDuBMNBei/Qb7y2QNNBSOM+HImz5xPqPqqRMou00B97wrlEyj6wM7mtf6
ln276amsWKgrO+Scgqql60cbU3FFxZYx6jC2CkpclMTFAcdPYP9Ea5iiIoUSxEH7unDLDnGb/
ATt3xQL5Jm0xy8mOfSZlw6oVtq0BsgnD5bqZTEzJlZ+g7lQliSXuDA7JfxGRd5kHUiCGBOq3e
A0+/a7owAmtGSz9o/4J4j6VCrkV4MX4G7MCvdng/QaTpREAXDtR0XTdRqBNZIPRQFe/8/IdgM
O2kWeuhbt2+bXU1AN0td9zl+MlWMfECuImIJ3olVvDrVoLKX8tLe8GVirBTj30Fk8bZkOh/Vz
c/njPklo06V6cXf5oTqtQ6C5qMJHzG0rGSNACOV+hCTGNrzFyD9AAEn/yDiYuES3B+iDZ7s3A
UWpXNORTU7tFx5XdJbonofGO21ogw==
X-Spam-Status: No, score=-95.3 required=5.0 tests=BAYES_00,
GOOD_FROM_CORINNA_CYGWIN, KAM_ASCII_DIVIDERS, KAM_DMARC_NONE, KAM_DMARC_STATUS,
KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_FAIL, SPF_HELO_NONE,
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-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi Fridjof,

Please don't top-post.

On Nov  4 13:30, Fritjof Bornebusch wrote:
> On Nov  4 13:57, marco atzeri wrote:
>> On Fri, Nov 4, 2022 at 1:16 PM Fritjof Bornebusch wrote:
>> >
>> > Hi,
>> >
>> > I need to write files whose path exceed the maximum value of 260 characters.
>> > Using Windows paths, you can add \\?\ as prefix, e.g., \\?\C:\Users\foo\bar\<file://%3f/C:/Users/foo/bar/>....
>> >
>> > However, it seems like this is not the case in Cygwin. When I use \\?\/home/foo/bar<file://%3f/home/foo/bar>, I get no file pointer back.
>> >
>> > Does someone have a clue how I can bypass this?
>> >
>> > Best,
>> > Fritjof
>> >
>> 
>> Have you tried POSIX style ?
>> /cygdrive/C/Users/foo/bar..
> 
> Jep,
> 
> No success.

Works for me:

======================================================================
$ cat > longp.sh <<EOF
#!/bin/bash

POSIX_MAX=4096
# 240 chars per path component
DIRNAM="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

LPATH=/tmp
cd /tmp

while [ $(echo -n "$LPATH" | wc -c) -lt $POSIX_MAX ]
do
  mkdir "$DIRNAM" || exit 1
  LPATH="$LPATH/$DIRNAM"
  ls -d "$LPATH" || exit 2
  cd "$LPATH" || exit 3
  echo "Current length: $(echo -n $LPATH | wc -c)"
  sleep 1
done
EOF
$ chmod +x longp.sh
$ ./longp.sh
/tmp/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Current length: 245
[...]
12345678901234567890/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Current length: 4101
$
======================================================================

If you have specific trouble, please provide a specific, simple testcase,
preferredly in plain C or as shell script.


Thanks,
Corinna

-- 
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