Index: src/fr-archive.c
===================================================================
--- src/fr-archive.c	(revision 2175)
+++ src/fr-archive.c	(working copy)
@@ -39,6 +39,7 @@
 #include "fr-archive.h"
 #include "fr-command.h"
 #include "fr-command-ace.h"
+#include "fr-command-alz.h"
 #include "fr-command-ar.h"
 #include "fr-command-arj.h"
 #include "fr-command-cfile.h"
@@ -553,6 +554,9 @@
 	} else if (is_mime_type (mime_type, "application/x-cpio")) {
 		archive->command = fr_command_cpio_new (archive->process,
 							filename);
+	} else if (is_mime_type (mime_type, "application/x-alz")) {
+		archive->command = fr_command_alz_new (archive->process,
+						       filename);
 	} else
 		return FALSE;
 
@@ -3171,6 +3175,7 @@
 	e_filtered = escape_file_list (archive->command, filtered);
 
 	if (move_to_dest_dir) {
+
 		char *temp_dir;
 		char *e_temp_dir;
 
Index: src/fr-command-alz.c
===================================================================
--- src/fr-command-alz.c	(revision 0)
+++ src/fr-command-alz.c	(revision 0)
@@ -0,0 +1,408 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  File-Roller
+ *
+ *  Copyright (C) 2001 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include "file-data.h"
+#include "file-utils.h"
+#include "fr-command.h"
+#include "fr-command-alz.h"
+
+static void fr_command_alz_class_init  (FrCommandAlzClass *class);
+static void fr_command_alz_init        (FrCommand         *afile);
+static void fr_command_alz_finalize    (GObject           *object);
+
+/* Parent Class */
+
+static FrCommandClass *parent_class = NULL;
+
+
+/* -- list -- */
+
+static time_t
+mktime_from_string (char *date_s, 
+		    char *time_s)
+{
+	struct tm   tm = {0, };
+	char      **fields;
+
+	/* date */
+
+	fields = g_strsplit (date_s, "/", 3);
+	if (fields[0] != NULL) {
+		tm.tm_mon = atoi (fields[0]) - 1;
+		if (fields[1] != NULL) {
+			tm.tm_mday = atoi (fields[1]);
+			if (fields[2] != NULL)
+				tm.tm_year = 100 + atoi (fields[2]);
+		}
+	}
+	g_strfreev (fields);
+
+	/* time */
+
+	fields = g_strsplit (time_s, ":", 3);
+	if (fields[0] != NULL) {
+		tm.tm_hour = atoi (fields[0]);
+		if (fields[1] != NULL) 
+			tm.tm_min = atoi (fields[1]);
+	}
+	g_strfreev (fields);
+
+	return mktime (&tm);
+}
+
+
+static void
+process_line (char     *line, 
+	      gpointer  data)
+{
+	FrCommand     *comm = FR_COMMAND (data);
+	FrCommandAlz  *alz_comm = FR_COMMAND_ALZ (comm);
+	FileData      *fdata;
+	char         **fields;
+	char          *name_field;
+	char           name_last;
+	gsize	       name_len;
+
+	g_return_if_fail (line != NULL);
+
+
+	if (! alz_comm->list_started) {
+		if (strncmp (line, "-----", 5 ) == 0 ) {
+			alz_comm->list_started = TRUE;
+		}
+		return;
+	}
+
+	if (strncmp (line, "-----", 5 ) == 0) {
+		alz_comm->list_started = FALSE;
+		return;
+
+	}
+
+	if (! alz_comm->list_started) {
+		return;
+	}		
+
+	fdata = file_data_new();
+	fields = (char **)split_line (line, 5);
+	fdata->modified = mktime_from_string (fields[0], fields[1]);
+	fdata->size = g_ascii_strtoull (fields[3], NULL, 10);
+
+	name_field = g_strdup((const char*)get_last_field (line, 6));
+	name_len = strlen(name_field);
+
+	name_last = name_field[name_len - 1];
+	fdata->dir = name_last == '\\';
+	fdata->encrypted = name_last == '*';
+
+	if (fdata->dir || fdata->encrypted)
+		name_field[--name_len] = '\0';
+
+	if (*name_field == '/') {
+		fdata->full_path = g_strdup (name_field);
+		fdata->original_path = fdata->full_path;
+	} else {
+		fdata->full_path = g_strconcat ("/", name_field, NULL);
+		fdata->original_path = fdata->full_path + 1;
+	}
+
+	if (fdata->dir) {
+		char *s;
+		for (s = fdata->full_path; *s != '\0'; ++s)
+			if (*s == '\\') *s = '/';
+		for (s = fdata->original_path; *s != '\0'; ++s)
+			if (*s == '\\') *s = '/';
+
+		fdata->name = dir_name_from_path (fdata->full_path);
+	} else {
+		fdata->name = g_strdup (file_name_from_path (fdata->full_path));
+	}
+
+	fdata->path = remove_level_from_path (fdata->full_path);
+	fdata->link = NULL;
+
+	if (*fdata->name == 0)
+		file_data_free (fdata);
+	else
+		fr_command_add_file (comm, fdata);
+
+	g_free (name_field);
+	g_strfreev (fields);
+}
+
+
+
+static void
+add_codepage_arg (FrCommand	*comm)
+{
+	const char  *env_list[] = { "LC_CTYPE", "LC_ALL", "LANG", NULL };
+	const char **scan;
+	const char  *arg = "-cp949";
+
+	for (scan = env_list; *scan != NULL; ++scan) {
+		char *env = getenv (*scan);
+		if (! env) continue;
+
+		if (strstr (env, "UTF-8") ||  strstr (env, "utf-8"))
+			arg = "-utf8";
+		else if (strstr (env, "euc") || strstr (env, "EUC"))
+			arg = "-euc-kr";
+		else
+			continue;
+		break;
+	}
+
+	fr_process_add_arg (comm->process, arg);
+}
+
+
+static void
+add_password_arg (FrCommand	*comm,
+		  const char	*password,
+		  gboolean	disable_query)
+{
+	if (password != NULL) {
+		char *arg;
+		char *e_password;
+
+		fr_process_add_arg (comm->process, "-pwd");
+
+		e_password = (char *)escape_str (password, "\"*?[]'`()$!;");
+		if (e_password != NULL) {
+			arg = g_strconcat ("\"", e_password, "\"", NULL);
+			g_free (e_password);
+		} else
+			arg = g_strdup ("\"\"");
+
+		fr_process_add_arg (comm->process, arg);
+		g_free (arg);
+	} else if (disable_query) {
+		fr_process_add_arg (comm->process, "-pwd");
+		fr_process_add_arg (comm->process, ("\"\""));
+	}
+}
+
+
+static void
+fr_command_alz_list (FrCommand  *comm,
+		     const char *password)
+{
+	char *arg, *path;
+	char *filename;
+	char *path_dots;
+
+	FR_COMMAND_ALZ (comm)->list_started = FALSE;
+	FR_COMMAND_ALZ (comm)->invalid_password = FALSE;
+
+	fr_process_set_out_line_func (FR_COMMAND (comm)->process, 
+				      process_line,
+				      comm);
+
+	fr_process_begin_command (comm->process, "unalz");
+	fr_process_add_arg (comm->process, "-l");
+	add_codepage_arg(comm);
+	fr_process_add_arg (comm->process, comm->e_filename);
+	fr_process_end_command (comm->process);
+	fr_process_use_standard_locale (comm->process, TRUE);
+	fr_process_start (comm->process);
+}
+
+
+/* -- extract -- */
+
+static void
+process_extract_line (char     *line, 
+		      gpointer  data)
+{
+	FrCommand     *comm = FR_COMMAND (data);
+	FrCommandAlz  *alz_comm = FR_COMMAND_ALZ (comm);
+
+	g_return_if_fail (line != NULL);
+
+	/* - error check - */
+
+	if (strncmp (line, "err code(28) (invalid password)", 31) == 0) {
+		alz_comm->invalid_password = TRUE;
+		fr_process_stop(comm->process);
+		return;
+	}
+
+	if (alz_comm->extract_none &&
+	    strncmp (line, "unalziiiing :", 13) == 0) {
+		alz_comm->extract_none = FALSE;
+
+	} else if (strncmp (line, "done..", 6) == 0 &&
+		   alz_comm->extract_none) {
+		fr_process_stop(comm->process);
+		return;
+	}
+}
+
+
+static void
+fr_command_alz_extract (FrCommand  *comm,
+			GList      *file_list,
+			const char *dest_dir,
+			gboolean    overwrite,
+			gboolean    skip_older,
+			gboolean    junk_paths,
+			const char *password)
+{
+	GList *scan;
+
+	FR_COMMAND_ALZ (comm)->extract_none = TRUE;
+	fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+				      process_extract_line,
+				      comm);
+
+	fr_process_begin_command (comm->process, "unalz");
+
+	if (dest_dir != NULL) {
+		char *e_dest_dir = fr_command_escape (comm, dest_dir);
+		fr_process_add_arg (comm->process, "-d");
+		fr_process_add_arg (comm->process, e_dest_dir);
+		g_free (e_dest_dir);
+	}
+
+	add_codepage_arg (comm);
+	add_password_arg (comm, password, TRUE);
+
+	fr_process_add_arg (comm->process, comm->e_filename);
+
+	for (scan = file_list; scan; scan = scan->next) {
+		fr_process_add_arg (comm->process, scan->data);
+	}
+
+	fr_process_end_command (comm->process);
+}
+
+
+static void
+fr_command_alz_handle_error (FrCommand   *comm, 
+			     FRProcError *error)
+{
+	if ((error->type == FR_PROC_ERROR_STOPPED)) {
+		if  (FR_COMMAND_ALZ (comm)->extract_none ||
+		     FR_COMMAND_ALZ (comm)->invalid_password ) {
+			error->type = FR_PROC_ERROR_ASK_PASSWORD;
+		}
+	}
+}
+
+
+static void 
+fr_command_alz_class_init (FrCommandAlzClass *class)
+{
+        GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+        FrCommandClass *afc;
+
+        parent_class = g_type_class_peek_parent (class);
+	afc = (FrCommandClass*) class;
+
+	gobject_class->finalize = fr_command_alz_finalize;
+
+        afc->list         = fr_command_alz_list;
+	afc->add          = NULL;
+	afc->delete       = NULL;
+	afc->extract      = fr_command_alz_extract;
+	afc->handle_error = fr_command_alz_handle_error;
+}
+
+ 
+static void 
+fr_command_alz_init (FrCommand *comm)
+{
+	comm->file_type = FR_FILE_TYPE_ALZ;
+
+	comm->propCanModify                = FALSE;
+	comm->propAddCanUpdate             = FALSE;
+	comm->propAddCanReplace            = FALSE;
+	comm->propExtractCanAvoidOverwrite = FALSE;
+	comm->propExtractCanSkipOlder      = FALSE;
+	comm->propExtractCanJunkPaths      = FALSE;
+	comm->propPassword                 = TRUE;
+	comm->propTest                     = FALSE;
+}
+
+
+static void 
+fr_command_alz_finalize (GObject *object)
+{
+        g_return_if_fail (object != NULL);
+        g_return_if_fail (FR_IS_COMMAND_ALZ (object));
+
+	/* Chain up */
+        if (G_OBJECT_CLASS (parent_class)->finalize)
+		G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+GType
+fr_command_alz_get_type ()
+{
+        static GType type = 0;
+
+        if (! type) {
+                GTypeInfo type_info = {
+			sizeof (FrCommandAlzClass),
+			NULL,
+			NULL,
+			(GClassInitFunc) fr_command_alz_class_init,
+			NULL,
+			NULL,
+			sizeof (FrCommandAlz),
+			0,
+			(GInstanceInitFunc) fr_command_alz_init
+		};
+
+		type = g_type_register_static (FR_TYPE_COMMAND,
+					       "FrCommandAlz",
+					       &type_info,
+					       0);
+        }
+
+        return type;
+}
+
+
+FrCommand *
+fr_command_alz_new (FrProcess  *process,
+		    const char *filename)
+{
+	FrCommand *comm;
+
+	if (!is_program_in_path("unalz")) {
+		return NULL;
+	}
+
+	comm = FR_COMMAND (g_object_new (FR_TYPE_COMMAND_ALZ, NULL));
+	fr_command_construct (comm, process, filename);
+
+	return comm;
+}
Index: src/fr-command-alz.h
===================================================================
--- src/fr-command-alz.h	(revision 0)
+++ src/fr-command-alz.h	(revision 0)
@@ -0,0 +1,59 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  File-Roller
+ *
+ *  Copyright (C) 2001 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef FR_COMMAND_ALZ_H
+#define FR_COMMAND_ALZ_H
+
+#include <glib.h>
+#include "file-data.h"
+#include "fr-command.h"
+#include "fr-process.h"
+
+#define FR_TYPE_COMMAND_ALZ            (fr_command_alz_get_type ())
+#define FR_COMMAND_ALZ(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), FR_TYPE_COMMAND_ALZ, FrCommandAlz))
+#define FR_COMMAND_ALZ_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), FR_TYPE_COMMAND_ALZ, FrCommandAlzClass))
+#define FR_IS_COMMAND_ALZ(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FR_TYPE_COMMAND_ALZ))
+#define FR_IS_COMMAND_ALZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FR_TYPE_COMMAND_ALZ))
+#define FR_COMMAND_ALZ_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), FR_TYPE_COMMAND_ALZ, FrCommandAlzClass))
+
+typedef struct _FrCommandAlz       FrCommandAlz;
+typedef struct _FrCommandAlzClass  FrCommandAlzClass;
+
+struct _FrCommandAlz
+{
+	FrCommand  __parent;
+
+	gboolean extract_none;
+	gboolean invalid_password;
+	gboolean list_started;
+};
+
+struct _FrCommandAlzClass
+{
+	FrCommandClass __parent_class;
+};
+
+GType        fr_command_alz_get_type        (void);
+FrCommand*   fr_command_alz_new             (FrProcess *process,
+					     const char *filename);
+
+#endif /* FR_COMMAND_ALZ_H */
Index: src/main.c
===================================================================
--- src/main.c	(revision 2175)
+++ src/main.c	(working copy)
@@ -64,6 +64,7 @@
 
 FRFileTypeDescription file_type_desc[] = {
 	{ FR_FILE_TYPE_ACE,          ".ace",     "application/x-ace", N_("Ace (.ace)") },
+	{ FR_FILE_TYPE_ALZ,          ".alz",     "application/x-alz", N_("Alz (.alz)") },
 	{ FR_FILE_TYPE_AR,           ".ar",      "application/x-ar", N_("Ar (.ar)") },
 	{ FR_FILE_TYPE_ARJ,          ".arj",     "application/x-arj", N_("Arj (.arj)") },
 	{ FR_FILE_TYPE_BZIP,         ".bz",      "application/x-bzip", NULL },
@@ -128,7 +129,8 @@
 	{ "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_WAR },
 	{ "zoo",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_ZOO },
 	{ "7za",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_7ZIP },
-	{ "7zr",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_7ZIP }
+	{ "7zr",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_7ZIP },
+	{ "unalz",      TRUE,  FALSE, TRUE,  FR_FILE_TYPE_ALZ }
 };
 
 FRCommandDescription tar_command_desc[] = {
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 2175)
+++ src/Makefile.am	(working copy)
@@ -73,6 +73,8 @@
 	fr-command.h			\
 	fr-command-ace.c		\
 	fr-command-ace.h		\
+	fr-command-alz.c		\
+	fr-command-alz.h		\
 	fr-command-ar.c			\
 	fr-command-ar.h			\
 	fr-command-arj.c		\
Index: src/typedefs.h
===================================================================
--- src/typedefs.h	(revision 2175)
+++ src/typedefs.h	(working copy)
@@ -81,6 +81,7 @@
 
 typedef enum {
 	FR_FILE_TYPE_ACE,
+	FR_FILE_TYPE_ALZ,
 	FR_FILE_TYPE_AR,
 	FR_FILE_TYPE_ARJ,
 	FR_FILE_TYPE_BZIP,
Index: nautilus/nautilus-fileroller.c
===================================================================
--- nautilus/nautilus-fileroller.c	(revision 2175)
+++ nautilus/nautilus-fileroller.c	(working copy)
@@ -143,6 +143,7 @@
 
 
 static char *mime_types[] = {
+	"application/x-alz",
 	"application/x-ar",
 	"application/x-arj",
 	"application/x-bzip",
Index: data/file-roller.desktop.in.in
===================================================================
--- data/file-roller.desktop.in.in	(revision 2175)
+++ data/file-roller.desktop.in.in	(working copy)
@@ -10,7 +10,7 @@
 Type=Application
 Icon=file-roller
 Categories=GTK;GNOME;Utility;
-MimeType=application/x-ace;application/x-ar;application/x-arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-compress;application/x-compressed-tar;application/x-cpio;application/x-deb;application/x-gtar;application/x-gzip;application/x-lha;application/x-lhz;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;multipart/x-zip;application/x-rpm;application/x-jar;application/x-war;application/x-ear;application/x-java-archive;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-zoo;application/x-cd-image;application/x-7z-compressed;application/x-gzpostscript;
+MimeType=application/x-ace;application/x-alz;application/x-ar;application/x-arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-compress;application/x-compressed-tar;application/x-cpio;application/x-deb;application/x-gtar;application/x-gzip;application/x-lha;application/x-lhz;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;multipart/x-zip;application/x-rpm;application/x-jar;application/x-war;application/x-ear;application/x-java-archive;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-zoo;application/x-cd-image;application/x-7z-compressed;application/x-gzpostscript;
 X-GNOME-DocPath=file-roller/file-roller.xml
 X-GNOME-Bugzilla-Bugzilla=GNOME
 X-GNOME-Bugzilla-Product=file-roller
