Browse Source

These adds to the previous correct by not allowing linked or unwrittable files

to be written .. ofcourse how could an unwrittable file be written?
master
freesource 24 years ago
parent
commit
54add2136a
  1. 21
      BootRoot/YardBox.pm

21
BootRoot/YardBox.pm

@ -1175,7 +1175,8 @@ sub save_as {
"writable.\nUse [ File->Save As ] or " . "writable.\nUse [ File->Save As ] or " .
"[Alt-S] with the yard suffix."); "[Alt-S] with the yard suffix.");
$save_as->destroy; $save_as->destroy;
save_as(); return;
#save_as();
} }
} }
@ -1191,6 +1192,24 @@ sub save_as {
# this to happen. # this to happen.
if (-f $new && !$write_over) { if (-f $new && !$write_over) {
if ( file_mode("$new") =~ /l/ ) {
error_window("gBootRoot: ERROR: " .
"$new is not " .
"writable.\nUse [ File->Save As ] or " .
"[Alt-S] with the yard suffix.");
$save_as->destroy;
return;
}
elsif ( file_mode("$new") !~ /w/ ) {
error_window("gBootRoot: ERROR: " .
"$new is not " .
"writable.\nUse [ File->Save As ] or " .
"[Alt-S] with the yard suffix.");
$save_as->destroy;
return;
#save_as();
}
my $label = Gtk::Label->new("$new_template already exists, my $label = Gtk::Label->new("$new_template already exists,
do you want to write over it?"); do you want to write over it?");
$label->set_justify( 'left' ); $label->set_justify( 'left' );

Loading…
Cancel
Save