| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:reply-to:subject:to:references:from:message-id | |
| :date:mime-version:in-reply-to:content-type | |
| :content-transfer-encoding; q=dns; s=default; b=rTsnKvLlMXcC1hg7 | |
| peWmn18LroGZUlifK7AOrJ5JP/kHH5be1HM/NROac2DlOo/TIER/dMsl0cTMSQBf | |
| ESdPDogpchrbX1ZZck5Qa/12YViEj/60N01sixZiEeM4foZXKFRTWyo/jvU/+LuR | |
| qRzbw+GSSwIymGKJPS7ANg/Po7c= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:reply-to:subject:to:references:from:message-id | |
| :date:mime-version:in-reply-to:content-type | |
| :content-transfer-encoding; s=default; bh=KKZ6t7BRow1nL6gQfiEgjD | |
| s/YdA=; b=cWsesovBXmDzcGWib8zq9zZr/fvhcOEYxEEXhbWQcyggUF7gvVSfex | |
| KQ+j/tTJvsuUCW6tD2v5yHVrXOU7tg97+pIigNoK09lJwPrgg/K5MUfKxqtYBKBf | |
| Ss/0YZXihqJ+TsXNPsEqww3kZeLyQWEOMAl+lTwBN4CKJDQnJEco8= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Spam-SWARE-Status: | No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SCC_5_SHORT_WORD_LINES autolearn=no version=3.3.1 spammy=mini, transactions, USB, micro |
| X-HELO: | smtp-out-no.shaw.ca |
| Reply-To: | Brian DOT Inglis AT SystematicSw DOT ab DOT ca |
| Subject: | Re: Has rename syntax changed? |
| To: | cygwin AT cygwin DOT com |
| References: | <AM6PR03MB5282DB8DBC61B8331D880434A4E80 AT AM6PR03MB5282 DOT eurprd03 DOT prod DOT outlook DOT com> <CAD8GWsvpmfoNtmyN=ntqMF7k3bTy6ycp2EnxZ3ZGe5uz4LrtXw AT mail DOT gmail DOT com> <AM6PR03MB52826D4DAF6E696C5EF048D0A4E90 AT AM6PR03MB5282 DOT eurprd03 DOT prod DOT outlook DOT com> |
| From: | Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca> |
| Message-ID: | <98feaea2-4c96-8e8a-38ac-06873a81c423@SystematicSw.ab.ca> |
| Date: | Sat, 29 Feb 2020 08:48:49 -0700 |
| User-Agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
| MIME-Version: | 1.0 |
| In-Reply-To: | <AM6PR03MB52826D4DAF6E696C5EF048D0A4E90@AM6PR03MB5282.eurprd03.prod.outlook.com> |
| X-IsSubscribed: | yes |
On 2020-02-29 01:27, Fergus Daly wrote:
>> $ rename "anything" "AnyThing" *.ext
>> What I remember as past behaviour now fails, leaving he filename unaltered.
>
>>> Try it with the '-v' option
>
> So I did:
>
> $ touch "This is the test file"
> $ ls -al
> -rw-r--r-- 1 0 Feb 29 08:10 This is the test file
> $ rename -v " the " " The " *
> `This is the test file' -> `This is The test file'
> $ ls -al
> -rw-r--r-- 1 0 Feb 29 08:10 This is the test file
>
> Filename unaltered, contrary to verbose confirmation.
> Just checking: in DOS Command Prompt box, dir also shows filename unaltered.
> BTW failure consistent on both FAT32 and exFAT filesystems; but the rename command _works_as_expected_ on NTFS.
How that works will depend on the available VFAT LFN support on that filesystem.
> I get the subtle distinctions between FAT (all versions) and NTFS platforms; but, all the same, the rename command surely worked on *FAT* in the past - I would have noticed if it didn't because I toggle lc <> UC quite a lot.
You're not really giving us much that may help you, about what Windows and
Cygwin releases you're running, whether the file systems are local devices, or
on what type of remote system, what drive (USB 1/2/3/C, CF1/2, full/mini/micro
SD/SDHC/SDXC, makes, models, capacities), underlying formats, and driver types.
IIRC and I may not, you may be able to change case if you jump thru hoops and
also change the underlying 8.3 name at the same time e.g. rename "This is the
test file" to "This is The test file.txt" then "This is The test file"; perhaps
like:
$ rename -v "the test file" "The test file.txt" "This is the test file"
$ rename -v "The test file.txt" "The test file" "This is the test file.txt"
While rename can be useful for multiple files, for single files, and other
simple commands, I use bash filename completion on long file names, and editline
copy/paste to add brace expansions:
$ mv -v This\ is\ {the\ test\ file,The\ test\ file.txt}
$ mv -v This\ is\ {The\ test\ file.txt,The\ test\ file}
$ touch -chr file.{ref,new}
$ gcc -g -Og -Wall -Wextra -o test{,.c}
Check the type of the target filesystem using available tools to see if anything
changed and/or can be changed. If remote, check that system's filesystem driver
for any changes. From an elevated command prompt try e.g.
> fsutil fsinfo volumeinfo g:
Volume Name :
Volume Serial Number : 0x6d26aae6
Max Component Length : 255
File System Name : NTFS
Is ReadWrite
Not Thinly-Provisioned
Supports Case-sensitive filenames
Preserves Case of filenames
Supports Unicode in filenames
Preserves & Enforces ACL's
Supports file-based Compression
Supports Disk Quotas
Supports Sparse files
Supports Reparse Points
Returns Handle Close Result Information
Supports POSIX-style Unlink and Rename
Supports Object Identifiers
Supports Encrypted File System
Supports Named Streams
Supports Transactions
Supports Hard Links
Supports Extended Attributes
Supports Open By FileID
Supports USN Journal
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |