Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'english,': 0.09; 'subject:files': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'ascii,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'modul': 0.16; 'restricting': 0.16; 'sensitivity.': 0.16; 'subject:remove': 0.16; 'unicode.': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'handling': 0.26; 'subject:/': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'file': 0.32; 'cases': 0.33; "i'd": 0.34; 'could': 0.34; "can't": 0.35; 'possible.': 0.35; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'easily': 0.37; 'generic': 0.38; 'tools,': 0.38; 'handle': 0.38; 'rather': 0.38; 'sure': 0.39; 'most': 0.60; 'simply': 0.61; "you're": 0.61; 'more': 0.64; 'different': 0.65; '2015': 0.84; 'flexibility,': 0.84; 'safer,': 0.84; 'to:none': 0.92 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:content-transfer-encoding; bh=9HqlQXogkVJ7TLu/h86NQHpmHhFK5Xs7aHDGgiOTsz4=; b=reZ/9GBxvTwNPq9blp9uD3ZctotK0NsZQI9c3Ah/PGSy+fGbnjCZWk6gthuG4NqUtQ 7vdoImVl/r15N8AWsDCUuPabm69AfQQOIPbVWvZRDic2SNneWbEXBCUHzF/0m5xoaoXJ mQ7IYAHZ5MsJ4n9NOT8bbVCdMqw4C9YL0wJ1G2goTA8RWl4dvR5HdMs6Y+h7Ty8017xm 5E5OsFD2bt2b7wlN3IB5jP5h+AzrQXmjRQGUwKWdwcaH9pn5QxUxmCu4c7EUTH5YSfWY A0bmx1S29wkX0nS7Ytj74DPrQR5wQEvN5/W/+9bGJW4ieRaWG1nD7mg+BWAaC78miYDI si6w== MIME-Version: 1.0 X-Received: by 10.107.7.94 with SMTP id 91mr66483695ioh.27.1420207291093; Fri, 02 Jan 2015 06:01:31 -0800 (PST) In-Reply-To: <20150102135132.GE24572@arxnet.hu> References: <20150102090051.GC22372@arxnet.hu> <20150102102153.GA89926@cskk.homeip.net> <20150102053552.6ed449b8@bigbox.christie.dr> <20150102123604.GB24295@arxnet.hu> <20150102135132.GE24572@arxnet.hu> Date: Sat, 3 Jan 2015 01:01:31 +1100 Subject: Re: How do I remove/unlink wildcarded files From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420207299 news.xs4all.nl 2919 [2001:888:2000:d::a6]:55224 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83117 On Sat, Jan 3, 2015 at 12:51 AM, Ervin Heged=C3=BCs wro= te: > it may be at the concrete example in OP is better the glob - but > I think in most cases the re modul gives more flexibility, I mean > the glob modul can handle the upper/lower chars? I'm not sure that I'd want to. Handling case insensitivity is fine when you're restricting everything to ASCII, but it's rather harder when you allow all of Unicode. For instance, U+0069 and U+0049 would be considered case-insensitively equal in English, but in Turkish, they're different letters; U+0069 upper-cases to U+0130, and U+0049 lower-cases to U+0131. Much safer, when you're writing generic tools, to simply require case sensitivity. And you can't easily know whether the file system is case-sensitive, case-retaining, or case-folding; you could easily have multiple mounts that differ, so "/home/rosuav/foo/bar/quux" might be the same as "/home/rosuav/FOO/bar/quux", but the other four components are all case sensitive. Yes, it really is possible. ChrisA