May 19, 2015
On Tuesday, 19 May 2015 at 18:46:34 UTC, Jacob Carlborg wrote:
> Support for RAR archives would be nice.

It would be nice, but there isn't a great deal of documentation (publicly, at least). The RAR developers provide code for extracting it, but the licence forbids reverse engineering. At that point, it's murky water and down to law.

For example, the UK's Copyright, Designs, and Patents Act allows reverse-engineering (and explicitly supersedes any licences), but only under certain conditons. The act states that decompilation/reverse-engineering is not allowed if you "[supply] the information obtained by the decompiling to any person to whom it is not necessary to supply it in order to achieve the permitted objective." Whether releasing D source code derived from a decompiled binary counts as "[supplying] to any person to whom it is not necessary..." is not something I'm qualified to determine.

RARLAB have published technotes on the format, but I haven't read through them and it is possible that they don't give enough information. The technote on the RARLAB website also only seems to be for RAR 5.0, so supporting older versions could be an issue.
May 20, 2015
On Tuesday, 19 May 2015 at 19:28:03 UTC, Liam McSherry wrote:
> On Tuesday, 19 May 2015 at 18:46:34 UTC, Jacob Carlborg wrote:
>> Support for RAR archives would be nice.
>
> It would be nice, but there isn't a great deal of documentation (publicly, at least). The RAR developers provide code for extracting it, but the licence forbids reverse engineering.

http://www.rarlab.com/rar/unrarsrc-5.2.7.tar.gz why do you need reverse engineering?
May 20, 2015
On Wednesday, 20 May 2015 at 08:26:11 UTC, Kagamin wrote:
> http://www.rarlab.com/rar/unrarsrc-5.2.7.tar.gz why do you need reverse engineering?

UnRAR only extracts RAR archives, there's no facility to create them. If you wanted to create them, you would need to do some form of reverse engineering. UnRAR's licence is also fairly widely considered to be bad.

> ******    *****   ******   UnRAR - free utility for RAR archives
> **   **  **   **  **   **  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ******   *******  ******    License for use and distribution of
> **   **  **   **  **   **   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> **   **  **   **  **   **         FREE portable version
> ~~~~~~~~~~~~~~~~~~~~~
> 
> The source code of UnRAR utility is freeware. This means:
> 
> 1. All copyrights to RAR and the utility UnRAR are exclusively
> owned by the author - Alexander Roshal.
> 
> 2. The UnRAR sources may be used in any software to handle RAR
> archives without limitations free of charge, but cannot be used
> to re-create the RAR compression algorithm, which is proprietary.
> Distribution of modified UnRAR sources in separate form or as a
> part of other software is permitted, provided that it is clearly
> stated in the documentation and source comments that the code may
> not be used to develop a RAR (WinRAR) compatible archiver.
> 
> 3. The UnRAR utility may be freely distributed. It is allowed
> to distribute UnRAR inside of other software packages.
> 
> 4. THE RAR ARCHIVER AND THE UnRAR UTILITY ARE DISTRIBUTED "AS IS".
> NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED.  YOU USE AT
> YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS,
> DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING
> OR MISUSING THIS SOFTWARE.
> 
> 5. Installing and using the UnRAR utility signifies acceptance of
> these terms and conditions of the license.
> 
> 6. If you don't agree with terms of the license you must remove
> UnRAR files from your storage devices and cease to use the
> utility.
> 
> Thank you for your interest in RAR and UnRAR.
>
>
> Alexander L. Roshal

If UnRAR-derived code was in Phobos, everyone that used Phobos would be required to accept the above licence, or remove the RAR archiving module from their system.
May 20, 2015
On Tue, 19 May 2015 20:46:33 +0200, Jacob Carlborg wrote:

> Support for RAR archives would be nice.

considering unrar's license... why, 7zip is better in all ways, and it's opensource. i will really like to see a module to work with 7z archives in Phobos. rar archives will die, almost like ace archives are effectively dead now (and ACE was pretty good for it's time!).

May 20, 2015
On Wednesday, 20 May 2015 at 12:19:07 UTC, Liam McSherry wrote:
> On Wednesday, 20 May 2015 at 08:26:11 UTC, Kagamin wrote:
>> http://www.rarlab.com/rar/unrarsrc-5.2.7.tar.gz why do you need reverse engineering?
>
> UnRAR only extracts RAR archives

That's what all 3rd party archivers do. Only rarlab software can create rar archives.

> If UnRAR-derived code was in Phobos, everyone that used Phobos would be required to accept the above licence, or remove the RAR archiving module from their system.

I guess, the code was requested to be written. How to distribute it is a different question.
May 20, 2015
On Wednesday, 20 May 2015 at 14:43:17 UTC, Kagamin wrote:
>> UnRAR only extracts RAR archives
>
> That's what all 3rd party archivers do. Only rarlab software can create rar archives.

Which is one reason for not including RAR support, even if it would be nice.

I just checked the RAR 5.0 technote, and it only appears to cover the file format. No algorithms are described. So, there doesn't seem to be a way to support RAR without using UnRAR, and using UnRAR doesn't seem too likely due to its licence.
May 20, 2015
On 2015-05-19 21:28, Liam McSherry wrote:
> On Tuesday, 19 May 2015 at 18:46:34 UTC, Jacob Carlborg wrote:
>> Support for RAR archives would be nice.
>
> It would be nice, but there isn't a great deal of documentation
> (publicly, at least). The RAR developers provide code for extracting it,
> but the licence forbids reverse engineering. At that point, it's murky
> water and down to law.

libarchive supports it, which has a BSD license. Yeah, I know that we most likely cannot use it.

-- 
/Jacob Carlborg
May 20, 2015
On 2015-05-20 14:19, Liam McSherry wrote:
> On Wednesday, 20 May 2015 at 08:26:11 UTC, Kagamin wrote:
>> http://www.rarlab.com/rar/unrarsrc-5.2.7.tar.gz why do you need
>> reverse engineering?
>
> UnRAR only extracts RAR archives, there's no facility to create them. If
> you wanted to create them, you would need to do some form of reverse
> engineering. UnRAR's licence is also fairly widely considered to be bad.

I'm only interested in extracting RAR archives. There are many tools that can extract a lot of different archives but only create a couple of them.

-- 
/Jacob Carlborg
May 20, 2015
On 2015-05-20 15:46, ketmar wrote:

> considering unrar's license... why, 7zip is better in all ways, and it's
> opensource.

Doesn't matter, it's still used. BTW, I'm only interested in extracting.

-- 
/Jacob Carlborg
May 20, 2015
On Wednesday, 20 May 2015 at 18:55:11 UTC, Jacob Carlborg wrote:
> libarchive supports it, which has a BSD license. Yeah, I know that we most likely cannot use it.

If RAR support is to be had, interfacing with libarchive is probably going to be the best/easiest way to do it, although it would probably be better to focus on adding support for those archives that don't need an extra library first.