Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Make a unique filesystem path, without creating the file Date: Tue, 23 Feb 2016 05:25:08 +1100 Lines: 23 Message-ID: References: <85r3gf55k4.fsf@benfinney.id.au> <85mvr26dij.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de hFAfraMYTo4uhn1EFmN0yQjg/VubrJ97Ux8tLGfXDRvQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'correct.': 0.07; 'subject:file': 0.07; 'cc:addr:python-list': 0.09; 'filesystem': 0.09; '2016': 0.16; '23,': 0.16; 'accidental': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nonzero': 0.16; 'opposite': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fairly': 0.22; 'name;': 0.22; 'trying': 0.22; 'am,': 0.23; 'feb': 0.23; 'header:In-Reply-To:1': 0.24; 'checking': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this.': 0.28; 'path,': 0.29; 'entry': 0.31; 'point': 0.33; 'point,': 0.33; 'tue,': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'path': 0.35; 'quite': 0.35; 'but': 0.36; 'there': 0.36; 'possible.': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; "won't": 0.38; 'received:209': 0.38; 'subject:the': 0.39; 'real': 0.62; 'goal': 0.64; 'touch': 0.66; 'hand': 0.82; 'chrisa': 0.84; 'collision.': 0.84; 'touching': 0.84; 'unique.': 0.84; 'to:none': 0.91; 'ethan': 0.91; 'furman': 0.91; 'subject:Make': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=nva4wb5rsXxiS9CK5gehwQflHMxVIcNN5M+hWC4pRxw=; b=s09p+Vd5C2OoqQb/hMSMlgYgIhClBdCyAhS/NPCB+r5h+hjxnjUonYuhTPtvXhINV8 gNaKIvDaNpB6zFTLsw5fX/h0JYZLxJh/e9/whkREP7QtnZRS45RuNnusN9KUolIQNKMy QUBS9Wgk7t2HZpVDIo6jXD1knlIb4Nve9Es7XqSVbkK2b9SQtkDOH7kiM4SkhGJ5KyXT V4PEaBu5ceY+cCCOfiKmmRgXr1h8VggJInVTWyB0xOW3tg06jjUoZWuMKYYIyPUWiT4W u9Jv2/dp4P+LXyKllW6aPiEtrBimmE+pnAsNcfGORDt1bR8F5mJFJDsvyEOI4bmvi3vO /Zqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=nva4wb5rsXxiS9CK5gehwQflHMxVIcNN5M+hWC4pRxw=; b=c1ueYG9fzfWKn5YIxnzMCu39xmRdrKYLcFJFgmaVl6cQoVKBbsKEt1gut09EVEBUcN X8nJtVQTgDySLkDB1idfoic3kSCpX+MVdv89+lEezyaVzQYM2VJffnJsf5CrFFxuCQzV mVz7BSWnADd7AvJblmnSSxw7tuNc2JLkWD8mBAtXHzx4mlVji8jTBCSPuqaf1Sm20yDc q33dbdKf7cxve3ZbDHvM51vqXIoVtaOiVcn6P3cH811djcDcQ2/xNQkruZ41j80mPxL2 cPZhyN8AeG4eMJ3EgUiZLKK+X/IylXj3l19Hz/AyLyU3tliSwfwUOtkIf8WayxGDWq0D VjOA== X-Gm-Message-State: AG10YOTwyNaJdUHdT99RKDcopRaY5F6sU/+aBF9rtMvMsqe0WkZSlvxaNLXQKiDX7fSqDrK/yjb5EQ+8uYKVyA== X-Received: by 10.50.180.35 with SMTP id dl3mr1327810igc.94.1456165508807; Mon, 22 Feb 2016 10:25:08 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103351 On Tue, Feb 23, 2016 at 5:17 AM, Jon Ribbens wrote: > On 2016-02-22, Ethan Furman wrote: >> On 02/14/2016 04:08 PM, Ben Finney wrote: >>> I am unconcerned with whether there is a real filesystem entry of that >>> name; the goal entails having no filesystem activity for this. I want a >>> valid unique filesystem path, without touching the filesystem. >> >> This is impossible. If you don't touch the file system you have no way >> to know if the path is unique. > > Weeeeeell, I have a lot of sympathy for that point, but on the other > hand the whole concept of UUIDs ("import uuid") is predicated on the > opposite assumption. Not quite opposite. Ethan is asserting that you cannot be *certain* without actually checking the FS; the point of UUIDs is that you can be fairly *confident* that there won't be a collision. There is a nonzero probability of accidental collisions, and if an attacker is deliberately trying to _force_ a collision, it's most definitely possible. So both views are correct. ChrisA