1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-04-04 07:43:22 -04:00

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

to be written .. ofcourse how could an unwrittable file be written?
This commit is contained in:
freesource 2001-08-25 06:40:45 +00:00
parent 13932faa43
commit 54add2136a

View File

@ -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' );