I'm working on moving the content of a website, which was provided to me in a RAR archive, to a new server.
I'm not exactly sure which flavor of Linux it is; uname -a
tells me:
Linux bolt.sonic.net 2.4.37.5 #1 SMP Mon Aug 17 10:15:36 PDT 2009 i686 unknown
and unrar --help
tells me:
UNRAR 3.00 freeware Copyright (c) 1993-2002 Eugene Roshal
I'm not a regular user of unrar, but in my limited prior experience, the simple command unrar x archive.rar
has always done the right thing, as far as I can remember.
But when I try to unpack the current archive, the result is a flat-structured directory containing 4500-odd files and directories whose names have backslashes in them where directory-separators should be, e.g.:
drwxr-xr-x 2 yoyodyne user 4096 Jan 18 14:53 yoyodyne
drwxr-xr-x 2 yoyodyne user 4096 Jan 18 14:53 yoyodyne\application
drwxr-xr-x 2 yoyodyne user 4096 Jan 18 14:53 yoyodyne\application\config
-rw-r--r-- 1 yoyodyne user 2765 Sep 15 2011 yoyodyne\application\config\database.php
-rw-r--r-- 1 yoyodyne user 1152 Sep 15 2011 yoyodyne\application\config\doctypes.php
-rw-r--r-- 1 yoyodyne user 1844 Sep 15 2011 yoyodyne\application\config\foreign_chars.php
-rw-r--r-- 1 yoyodyne user 513 Sep 15 2011 yoyodyne\application\config\hooks.php
-rw-r--r-- 1 yoyodyne user 123 Sep 15 2011 yoyodyne\application\config\index.html
...
I'm at a complete loss to understand what's causing this to happen, or how to get around it. I'm not seeing any obvious options on the unrar
command that tell it, for instance, "Hey, I'm on a Linux system", or "Hey, ignore the fact that this archive was created on a Windows system."
(Actually, I don't know whether the archive was created on a Windows system or not. The developer who sent me the archive didn't say, and promptly went on vacation immediately afterwards -- meaning that my chances of getting an answer, or a replacement archive in a different format, are slim.)
For what it's worth, the unrar
program seems to understand that the part of the name after the last backslash is the actual filename. The part of the output of unrar l archive.rar
corresponding to the partial directory listing above is:
Name Size Packed Ratio Date Time Attr CRC Meth Ver
-------------------------------------------------------------------------------
database.php 2765 1071 38% 15-09-11 10:57 .....A 13CDB2C8 m3g 2.9
doctypes.php 1152 381 33% 15-09-11 10:57 .....A F25E706F m3g 2.9
foreign_chars.php 1844 856 46% 15-09-11 10:57 .....A 12AF75FD m3g 2.9
hooks.php 513 285 55% 15-09-11 10:57 .....A 4029E30E m3g 2.9
index.html 123 107 86% 15-09-11 10:57 .....A E8DFAEB4 m3g 2.9
...
config 0 0 0% 18-01-13 14:53 .D.... 00000000 m0 2.0
...
application 0 0 0% 18-01-13 14:53 .D.... 00000000 m0 2.0
...
So given this, and given that the unrar
program is running on a Linux system, why is it creating these crazy filenames? And what can I do about it?
uname -a
tell you which Linux (kernel) version it is. I assume you wanted to find out which distribution (e.g. CentOS, Debian, Ubuntu, ...) it is. As far as I know there is no command to discover that, thoughls /etc
might help. (e.g. if it has a file slackware-version then it is slackware). Are for rar, my rar claimsUNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal
. Which means there is a newer version and you can test that (either on the destination, or try it first on your laptop to check if it works).uname -a
mainly so that I could include the output in my OP, in case any part of what it said might be helpful in figuring out the problem. :-) As to running a newer version of unrar on the sonic.net server, I now see that my earlier remark ("almost certainly not on a sonic.net server") was a little premature, since I could upload an executable myself, assuming I can find or build an architecturally-compatible one. Or maybe I could even build from source on the sonic.net server, if they have the necessary build tools.cat /etc/*-release
suggestion on the Sonic.net shell server and gotRed Hat Linux release 7.3 (Valhalla)
.