Author Topic: [SOLVED] Rename a corrupted folder ?  (Read 1656 times)

Arsène Leiris

  • Guest
[SOLVED] Rename a corrupted folder ?
« on: June 05, 2011, 02:03:45 AM »
Hi everyone,
after several transfers between MS and PCLinuxOS, my film folder "Vidéos" turned into "Vid?o" and now I can't access the files inside because it tells me that this folder doesn't exist... what can I do ? Rename it, how ?

its inode is : 278529
the shown name is : Vid?o
its console name : Vid\351os
its true name : Vidéos

Thank you !
« Last Edit: June 05, 2011, 10:54:08 AM by Arsène Leiris »

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Rename a corrupted folder ?
« Reply #1 on: June 05, 2011, 03:00:22 AM »
I'd open a console and try
Code: [Select]
mv Vid*o Vidéosin the parent folder. (If there are other files or folders whose names begin with "Vid" and end with an "o", it would make the problem more complicated.)

It's possible that
Code: [Select]
mv Vid?o Vidéoswould also work, but as the question mark in "Vid?o" stands for an escape sequence and not a single character it might not.

If you are going to continue transferring files to the same Windows install and back, you might even have to consider avoiding accented characters. (Or updating Windows, God forbid!)
« Last Edit: June 05, 2011, 03:12:53 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline bicol_willem

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2378
Re: Rename a corrupted folder ?
« Reply #2 on: June 05, 2011, 03:15:52 AM »
Hmm, following this with argus eyes!
I also got a zipfolder, sent by some "Windozer", some time ago containing a folder with music. Once extracted there seems no way to get rid of it. Folder name seems OK but the files inside have the same � (I think that is what you see?)
Not as user, not as root and even not from a live CD I can remove it!
Renaming fails as well. I am not trying to "steal" this thread but if a solution comes up for your problem it might serve me as well, you see.

Arsène Leiris

  • Guest
Re: Rename a corrupted folder ?
« Reply #3 on: June 05, 2011, 03:28:13 AM »
ok, so I have no alternative but to delete it, ok thank you !

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12519
Re: Rename a corrupted folder ?
« Reply #4 on: June 05, 2011, 03:29:22 AM »
ok, so I have no alternative but to delete it, ok thank you !

you can change the name by the mv command and putting the name in quotes via command line.

mv "Vid?o" video


Thanks to everyone who donates. You keep the servers running.

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Rename a corrupted folder ?
« Reply #5 on: June 05, 2011, 03:29:48 AM »
Hmm, following this with argus eyes!
I also got a zipfolder, sent by some "Windozer", some time ago containing a folder with music. Once extracted there seems no way to get rid of it. Folder name seems OK but the files inside have the same � (I think that is what you see?)
Not as user, not as root and even not from a live CD I can remove it!
Renaming fails as well. I am not trying to "steal" this thread but if a solution comes up for your problem it might serve me as well, you see.

Your PCLinuxOS has been set up to use UTF-8 while the name of the directory was probably created with another encoding. You can usually remove the files one by one with the command rm <name of file> replacing the offending characters in <name of file> with the wildcards "?" (for a single character) or "*" (for any number of characters or an escape sequence). Just quoting the name is not always enough.

(Removing the whole folder with rm -rf <name of folder> may not necessarily work in this case.)

Edited.
« Last Edit: June 05, 2011, 04:43:26 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Rename a corrupted folder ?
« Reply #6 on: June 05, 2011, 03:35:14 AM »
ok, so I have no alternative but to delete it, ok thank you !

No, I tried to suggest how you could rename it, not delete it. ("mv" stands for "move" and is used for renaming too.) But you could first check if Texstar's solution works.

And, by the way, "é" is a perfectly legal character; it's just that it may be coded in different ways in Linux and at least older versions of Windows.
« Last Edit: June 05, 2011, 03:40:40 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Arsène Leiris

  • Guest
Re: Rename a corrupted folder ?
« Reply #7 on: June 05, 2011, 03:46:11 AM »
it doesn't work
Code: [Select]
mv: impossible d'évaluer « Vid?o »: Aucun fichier ou dossier de ce typethe folder Vid?o is not found, is there no way to rename it with the inode ?

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12519
Re: Rename a corrupted folder ?
« Reply #8 on: June 05, 2011, 03:49:40 AM »
it doesn't work
Code: [Select]
mv: impossible d'évaluer « Vid?o »: Aucun fichier ou dossier de ce typethe folder Vid?o is not found, is there no way to rename it with the inode ?

It works for me.
texstar@localhost ~]$ mv "Vid?o" Videos

You have to put Vid?o in quotes like this: "Vid?o"

or mv "Vid\351os" Videos



Thanks to everyone who donates. You keep the servers running.

Arsène Leiris

  • Guest
Re: Rename a corrupted folder ?
« Reply #9 on: June 05, 2011, 03:54:30 AM »
it is not a regular ? but � -> Vid\351os
when i use rm -f the name of the folder is Vid\351os

when I try "Vid\351os" it doesn't work either
Quote
mv: impossible d'évaluer « Vid\\351os »: Aucun fichier ou dossier de ce type

Actually... I remember that this modification of the name happened when I replaced PCLinuxOS FR root by the PCLinuxOS US root. I re-installed PCLinuxOS with the official CD and not with the french one.

If we could use both mv and inode it would be perfect I think.
« Last Edit: June 05, 2011, 04:01:23 AM by Arsène Leiris »

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Rename a corrupted folder ?
« Reply #10 on: June 05, 2011, 04:01:03 AM »
Hi everyone,
after several transfers between MS and PCLinuxOS, my film folder "Vidéos" turned into "Vid?o" and now I can't access the files inside because it tells me that this folder doesn't exist... what can I do ? Rename it, how ?

its inode is : 278529
the shown name is : Vid?o
its console name : Vid\351os
its true name : Vidéos

Thank you !

this type of issues arise when you switch from one encoding to another one.
You say "its the true name", but this is true only for some alphabet i.e. iso-8859-1.

There is an utility, iconv, available on PCLinuxOS, made to solve your issue.
see man iconv and iconv --list

AS

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Rename a corrupted folder ?
« Reply #11 on: June 05, 2011, 04:03:07 AM »
it doesn't work
Code: [Select]
mv: impossible d'évaluer « Vid?o »: Aucun fichier ou dossier de ce typethe folder Vid?o is not found, is there no way to rename it with the inode ?

It works for me.
texstar@localhost ~]$ mv "Vid?o" Videos

You have to put Vid?o in quotes like this: "Vid?o"

or mv "Vid\351os" Videos




As the offending character isn't really a single character but the escape sequence "\351", try using "*" instead of  "?":

Code: [Select]
mv Vid*o Vidéos
If you write out the escape sequence, you need the quotes as Tex explained, if you just use a wildcard, they shouldn't be necessary. (The quotes will result in "\351" being interpreted literally and not as an escape sequence, but that shouldn't matter.)

« Last Edit: June 05, 2011, 04:57:04 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Arsène Leiris

  • Guest
Re: Rename a corrupted folder ?
« Reply #12 on: June 05, 2011, 04:06:35 AM »
Code: [Select]
mv: impossible d'évaluer « Vid*o »: Aucun fichier ou dossier de ce type doesn't work... I'll try iconv

Offline bicol_willem

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2378
Re: Rename a corrupted folder ?
« Reply #13 on: June 05, 2011, 04:12:03 AM »
Hmm, following this with argus eyes!
I also got a zipfolder, sent by some "Windozer", some time ago containing a folder with music. Once extracted there seems no way to get rid of it. Folder name seems OK but the files inside have the same � (I think that is what you see?)
Not as user, not as root and even not from a live CD I can remove it!
Renaming fails as well. I am not trying to "steal" this thread but if a solution comes up for your problem it might serve me as well, you see.

Your PCLinuxOS has been set up to use UTF-8 while the name of the directory was probably created with another encoding. You can usually remove the files one by one with the command rm <name of file> or the whole folder with rm -rf <name of folder> replacing the offending characters in <name of file/folder> with the wildcards "?" (for a single character) or "*" (for any number of characters or an escape sequence). Just quoting the name is not always enough.


I wish you was right here .....

After trying as user I went for root. The "rm" command seems to break up and ... well, look for self:

[root@linux Andrea Berg - Traume lugen nicht]# rm 01 - Andrea Berg - Warum nur tr?umen.mp3
rm: cannot remove `01': No such file or directory
rm: cannot remove `-': No such file or directory
rm: cannot remove `Andrea': No such file or directory
rm: cannot remove `Berg': No such file or directory
rm: cannot remove `-': No such file or directory
rm: cannot remove `Warum': No such file or directory
rm: cannot remove `nur': No such file or directory
rm: cannot remove `tr?umen.mp3': No such file or directory
[root@linux Andrea Berg - Traume lugen nicht]#

Mind you I cannot rename the files ....

Tried rm -rf against the folder and look:

[root@linux Music]# rm -rf Andrea Berg - Traume lugen nicht
[root@linux Music]#

Now you would think the folder is gone ...... Wrong! It's here to stay ....
Unbelievable stuff  ???

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: Rename a corrupted folder ?
« Reply #14 on: June 05, 2011, 04:17:52 AM »
Hmm, following this with argus eyes!
I also got a zipfolder, sent by some "Windozer", some time ago containing a folder with music. Once extracted there seems no way to get rid of it. Folder name seems OK but the files inside have the same � (I think that is what you see?)
Not as user, not as root and even not from a live CD I can remove it!
Renaming fails as well. I am not trying to "steal" this thread but if a solution comes up for your problem it might serve me as well, you see.

Your PCLinuxOS has been set up to use UTF-8 while the name of the directory was probably created with another encoding. You can usually remove the files one by one with the command rm <name of file> or the whole folder with rm -rf <name of folder> replacing the offending characters in <name of file/folder> with the wildcards "?" (for a single character) or "*" (for any number of characters or an escape sequence). Just quoting the name is not always enough.


I wish you was right here .....

After trying as user I went for root. The "rm" command seems to break up and ... well, look for self:

[root@linux Andrea Berg - Traume lugen nicht]# rm 01 - Andrea Berg - Warum nur tr?umen.mp3
rm: cannot remove `01': No such file or directory
rm: cannot remove `-': No such file or directory
rm: cannot remove `Andrea': No such file or directory
rm: cannot remove `Berg': No such file or directory
rm: cannot remove `-': No such file or directory
rm: cannot remove `Warum': No such file or directory
rm: cannot remove `nur': No such file or directory
rm: cannot remove `tr?umen.mp3': No such file or directory
[root@linux Andrea Berg - Traume lugen nicht]#

Mind you I cannot rename the files ....

Tried rm -rf against the folder and look:

[root@linux Music]# rm -rf Andrea Berg - Traume lugen nicht
[root@linux Music]#

Now you would think the folder is gone ...... Wrong! It's here to stay ....
Unbelievable stuff  ???


The problem is the spaces in the name 01 - Andrea Berg - Warum nur tr?umen.mp3. The shell sees them as separators. You could try escaping them with backslashes like this:
01\ -\ Andrea Berg\ -\ Warum\ nur\ tr?umen.mp3

Just using quotes will not work. In:
"01 - Andrea Berg - Warum nur tr?umen.mp3"
the shell will simply see "?" as a character and not as a wildcard. I just tested it.

Edit: I wasn't thinking straight when I wrote:

Quote
You can usually remove the files one by one with the command rm <name of file> or the whole folder with rm -rf <name of folder> replacing the offending characters in <name of file/folder> with the wildcards "?" (for a single character) or "*" (for any number of characters or an escape sequence).

rm -rf <name of folder> does work if there are offending characters in the name of the folder; it doesn't necessarily work if there are strange characters or (for instance) spaces in the names of individual files within the folder. Then you may have to remove the files one by one. I've edited my post above.

Edit 2: If the question mark representing "ä" in "tr?umen" doesn't work, try an asterisk instead.
« Last Edit: June 19, 2011, 04:14:02 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D