diff -rup sound-juicer/src/sj-extracting.c my-sj/src/sj-extracting.c
--- sound-juicer/src/sj-extracting.c	2006-10-23 15:22:23.000000000 -0400
+++ my-sj/src/sj-extracting.c	2007-01-30 19:47:06.000000000 -0500
@@ -110,26 +110,40 @@ static char*
 build_filename (const TrackDetails *track)
 {
   GnomeVFSURI *uri, *new;
-  char *realfile, *realpath, *filename, *string;
+  gchar *realpath, *filename, *string;
+  GString *realfile, *extension, *tmp;
   GMAudioProfile *profile;
 
   g_object_get (extractor, "profile", &profile, NULL);
 
   uri = gnome_vfs_uri_new (base_uri);
 
+  extension = g_string_new (gm_audio_profile_get_extension(profile));
+
   realpath = filepath_parse_pattern (path_pattern, track);
   new = gnome_vfs_uri_append_path (uri, realpath);
   gnome_vfs_uri_unref (uri); uri = new;
   g_free (realpath);
 
-  realfile = filepath_parse_pattern (file_pattern, track);
-  filename = g_strdup_printf("%s.%s", realfile, gm_audio_profile_get_extension(profile));
+  /* Truncate the filename to have room for the DOTextension part*/
+  realfile = g_string_new (filepath_parse_pattern (file_pattern, track));
+  g_string_truncate (realfile, NAME_MAX - (extension->len + 1));
+  filename = g_strdup_printf("%s.%s", realfile->str, extension->str);
+  g_free (realfile);
+  g_free (extension);
+
+  // Make sure the whole thing wont be larger than 1024 bytes, plus the slash
+  tmp = g_string_new (filename);
+  uri = g_string_truncate (uri, MAXPATHLEN - 1 - tmp->len);
+  g_free (tmp);
+
   new = gnome_vfs_uri_append_file_name (uri, filename);
   gnome_vfs_uri_unref (uri); uri = new;
-  g_free (filename); g_free (realfile);
+  g_free (filename);
 
   string = gnome_vfs_uri_to_string (uri, 0);
   gnome_vfs_uri_unref (uri);
+
   return string;
 }
 
@@ -668,6 +682,7 @@ sanitize_path (const char* str)
     /* TODO: I'd like this to compress whitespace aswell */
     g_strdelimit (s, "\t ", '_');
   }
+
   res = g_filename_from_utf8(s, -1, NULL, NULL, NULL);
   g_free(s);
   return res ? res : g_strdup(str);
@@ -832,6 +847,9 @@ filepath_parse_pattern (const char* patt
       ++p;
   }
 
+  /* Most file systems have a limit how large we can be */
+  g_string_truncate (s, NAME_MAX);
+
   str = s->str;
   g_string_free (s, FALSE);
   return str;
diff -rup sound-juicer/src/sj-extracting.h my-sj/src/sj-extracting.h
--- sound-juicer/src/sj-extracting.h	2006-10-23 15:22:23.000000000 -0400
+++ my-sj/src/sj-extracting.h	2007-01-30 19:47:45.000000000 -0500
@@ -26,6 +26,10 @@
 #include <gtk/gtkwidget.h>
 #include "sj-structures.h"
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
 void on_extract_activate (GtkWidget *button, gpointer user_data);
 char *filepath_parse_pattern (const char* pattern, const TrackDetails *track);
