Opened 16 years ago
Closed 16 years ago
#496 closed defect (fixed)
g.rename vect=Map1,map1 doesn't work
Reported by: | hamish | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 6.4.0 |
Component: | Vector | Version: | 6.4.0 RCs |
Keywords: | g.rename | Cc: | |
CPU: | x86-32 | Platform: | Linux |
Description
Hi,
g.rename vect=Map1,map1
is a no-op. The map is not renamed. :(
in the above example there was no attached DB. not sure what happens if there is (ie partial rename->breakage?).
perhaps due to some MS-Windows accommodation which has gone too far? I've been using case sensitive names for years to indicate type of map / protection from typos. Losing the ability to manage them properly or having all treated as lowercase() would stink.
?, Hamish
Change History (4)
comment:1 by , 16 years ago
follow-up: 3 comment:2 by , 16 years ago
mmph.
how about a warning then:
Index: general/manage/cmd/rename.c =================================================================== --- general/manage/cmd/rename.c (revision 35912) +++ general/manage/cmd/rename.c (working copy) @@ -84,8 +84,8 @@ G_warning(_("<%s> is an illegal file name"), new); continue; } - if (strcmp(old, new) == 0) { - G_warning(_("%s=%s,%s: files are the same, no rename required"), + if (strcasecmp(old, new) == 0) { + G_warning(_("%s=%s,%s: files could be the same, no rename possible"), parm[n]->key, old, new); continue; }
(afaict this only affects g.rename)
Hamish
follow-up: 4 comment:3 by , 16 years ago
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Replying to hamish:
This is intentional.
It's more accurate to say "non-Unix filesystem accommodation"; you can use [V]FAT, NTFS, SMB/CIFS, etc filesystems from Unix.
The problem is that if we used a case-sensitive check and the filesystem happens to be case-insensitive, the above command would simply delete the map. This was considered to be a bad thing. Sufficiently bad that, until someone can come up with a 100%-reliable mechanism for determining whether or not the filesystem is case-sensitive (I'm not holding my breath), we always assume that the filesystem might be case-insensitive.
If you want to change the case, you will have to do it in two steps, e.g.: