fish -N option unconditionally overwrites test*.img files.
authorRichard Jones <rjones@redhat.com>
Sat, 8 May 2010 08:09:24 +0000 (09:09 +0100)
committerRichard Jones <rjones@redhat.com>
Sat, 8 May 2010 08:09:24 +0000 (09:09 +0100)
This is more convenient and makes it consistent with the
'alloc' and 'sparse' commands.

fish/guestfish.pod
fish/prep.c

index cc974d7..7260caf 100644 (file)
@@ -551,7 +551,7 @@ multiple times (and can be mixed with I<-a>).
 
 The new disk is called C<test1.img> for the first I<-N>, C<test2.img>
 for the second and so on.  Existing files in the current directory are
 
 The new disk is called C<test1.img> for the first I<-N>, C<test2.img>
 for the second and so on.  Existing files in the current directory are
-not overwritten, so you may need to do C<rm -f test1.img>.
+I<overwritten>.
 
 The type briefly describes how the disk should be sized, partitioned,
 how filesystem(s) should be created, and how content should be added.
 
 The type briefly describes how the disk should be sized, partitioned,
 how filesystem(s) should be created, and how content should be added.
index ab5b4bc..6fd1d6b 100644 (file)
@@ -156,12 +156,6 @@ struct prep_data {
 prep_data *
 create_prepared_file (const char *type_string, const char *filename)
 {
 prep_data *
 create_prepared_file (const char *type_string, const char *filename)
 {
-  if (access (filename, F_OK) == 0) {
-    fprintf (stderr, _("guestfish: file '%s' exists and the '-N' option will not overwrite it\n"),
-             filename);
-    exit (EXIT_FAILURE);
-  }
-
   prep_data *data = parse_type_string (type_string);
   if (data->prep->prelaunch)
     data->prep->prelaunch (filename, data);
   prep_data *data = parse_type_string (type_string);
   if (data->prep->prelaunch)
     data->prep->prelaunch (filename, data);