From 54add2136a816e2398413b9ce56d7c1adf4603a2 Mon Sep 17 00:00:00 2001 From: freesource Date: Sat, 25 Aug 2001 06:40:45 +0000 Subject: [PATCH] These adds to the previous correct by not allowing linked or unwrittable files to be written .. ofcourse how could an unwrittable file be written? --- BootRoot/YardBox.pm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/BootRoot/YardBox.pm b/BootRoot/YardBox.pm index 35e6de2..ece378e 100644 --- a/BootRoot/YardBox.pm +++ b/BootRoot/YardBox.pm @@ -1175,7 +1175,8 @@ sub save_as { "writable.\nUse [ File->Save As ] or " . "[Alt-S] with the yard suffix."); $save_as->destroy; - save_as(); + return; + #save_as(); } } @@ -1191,6 +1192,24 @@ sub save_as { # this to happen. 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, do you want to write over it?"); $label->set_justify( 'left' );