Showing posts with label burn. Show all posts
Showing posts with label burn. Show all posts

Tuesday, May 10, 2011

Diff and Patch a file in Linux

Yesterday i ran into an Problem, i needed to Burn an DVD+R DL and the file i needed to burn was at 300Mbytes and an DVD+R DL got a capacity of 8,4 Gbytes. So i used the standard GROWISOFS command to start a normal Burn i selected the file and i told me the following weird message:


growisofs: :( more than 50% of space will be *wasted*!
                      go use single layer disc for this!


My mind was, what the hack ?! Linux is Open Source but i never thought it is  ecofriendly, so tried a few commands but no way, it wont let me burn a DVD when about 50% of space will be wasted ...


 A search later i found an PATCH to apply to get rid of this problem. As follows this is the patch file needed to apply on the original growisofs_mmc.cpp before compiling the whole program.

T

--- growisofs_mmc.cpp.orig      Mon Dec 28 02:58:51 2009
+++ growisofs_mmc.cpp   Mon Dec 28 03:00:12 2009
@@ -1622,11 +1622,6 @@ static void plus_r_dl_split (Scsi_Command &cmd,off64_t
     blocks = size/2048;
     blocks += 15, blocks &= ~15;

-    if (blocks <= split)
-       fprintf (stderr,":-( more than 50%% of space will be *wasted*!\n"
-                       "    use single layer media for this recording\n"),
-       exit (FATAL_START(EMEDIUMTYPE));
-
     blocks /= 16;
     blocks += 1;
     blocks /= 2;
@@ -2059,10 +2054,6 @@ pwrite64_t poor_mans_setup (void *fd,off64_t leadout)
                layer_size |= dvd_10[4+14]<<8,
                layer_size |= dvd_10[4+15];

-               if (data_size <= layer_size)
-                   fprintf (stderr,":-( more than 50%% of space will be *wasted*!\n"
-                                   "    use single layer media for this recording\n"),
-                   exit(FATAL_START(EMEDIUMTYPE));
            }
            if (is_dao && leadout)
                minus_r_reserve_track(cmd,leadout);


So to apply this simple patch file to our  growisofs_mmc.cpp we need to use the Program "patch" or "diff"
first i will guide you trough this patch file.

First Part:
--- growisofs_mmc.cpp.orig      Mon Dec 28 02:58:51 2009
+++ growisofs_mmc.cpp   Mon Dec 28 03:00:12 2009 

@@ -1622,11 +1622,6 @@ static void plus_r_dl_split (Scsi_Command &cmd,off64_t 

is the Description and some Info for the file itself, called lines of context...

Part Two:
the lines with an - in front of them are going to be deleted, the others are going to be changed.


So long we apply this patch with ->
patch growisofs_mmc.cpp < patch.txt
 
And voila this sould be the mesasge you'll get:
 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- growisofs_mmc.cpp Sun Feb 26 19:35:43 2006
|+++ growisofs_mmc.cpp Sun Feb 26 19:35:14 2006
--------------------------
Patching file patchtest using Plan A...
Hunk #1 succeeded at 2.
done 

The Google Patch :)


 No im able to waste Disks on my linux machine :D