What you could do is making a little batch file that would use RAR, a shareware command line utility for mac (I did not find any free rar command line utility, but RAR is available as a trial).
Installing rar command
To install RAR into your terminal, simply copy rar and unrar into your bin folder.
To get access to the bin directory, open Terminal.app and type
open /bin
The Windows version of RAR allows to "convert" zip archive into rar archive in tools, but the mac version doesn't seem to have this feature. The solution would be to unzip each of the files into separate folders and then to RAR content of those folders right away.
The Solution
I'm not very familiar (yet) with batch files and terminal but here is my attempt:
#!/bin/bash
# batch file that will convert zip files into rar files
# Require RAR for Mac os x to be placed in bin folder
# Working directory, use ~ for home folder shortcut :)
WorkingDirectory=~/test
# Temp directory that will be used for zip files manipulation
# Will prevent loop from raring other folders ;)
TempDirectory="${WorkingDirectory}"/zipToRarTemp
# Target Directory is where you want the rar files to go after the process
TargetDirectory="${WorkingDirectory}"
# Let's create the directories
mkdir "${TempDirectory}"
mkdir "${TargetDirectory}"
# Will loop into WorkingDirectory and unzip each .zip files
for file in "${WorkingDirectory}"/*.zip
do
# Get file name
# See http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
# 1st answer
filename=$(basename "$file")
extension="${filename##*.}"
filename="${filename%.*}"
# Temp folder in the loop
tempFolderToRar="${TempDirectory}"/"${filename}"
# Create folders to rar later
mkdir "${tempFolderToRar}"
# unzip -d folder/extract/to fileToExtract.zip
unzip -d "${TempDirectory}"/"${filename}" "${file}"
# rar all the files in tempFolderToRar into the target
rar a "${TargetDirectory}"/"${filename}".rar "${tempFolderToRar}"
done
# Optionnaly, delete temp directory if different from target
if [ "${TempDirectory}" != "${TargetDirectory}" ]
then
rm -r "${TempDirectory}"
fi
Save this to a file with no extension, be sure to set the good paths in the first variables and it should work fine running it in terminal.app
Conclusion
Well, It worked for me.
Note: there are a lot of " and it's to make it work with files named with spaces. Maybe there's a better way, but it works ;) Oh and sorry if code quality is bad, I just learned how to make batch files.
Hope it helps.
.rarfiles but not.zipfiles. – ohho Aug 16 '12 at 4:48