Ticket #1447 (closed defect: fixed)
Recreation of deleted file
| Reported by: | mj41 | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | editor | Version: | 0.97 |
| Keywords: | Cc: |
Description
What I did
- open fileA in Padre
- remove fileA in console
- Padre show Reload files
- select reload fileA
- Padre has empty file opened in editor
- empty file is also already saved/recreated
What I expected
- reload of removed file do not create new empty file but close file tab
Attachments
Change History
comment:1 Changed 10 months ago by bowtie
mj41
see patch for as far as I have got so far.
it looks like, a file being deleted externally is out side Padre scope, or it might just be my scope :)
as what ever i try just creates a zero byte file, or kills Padre.
I do like the error though -> This type of file (URL) is missing delete support.
:)
comment:2 Changed 10 months ago by bowtie
from mj41
-
Padre/lib/Padre/File/Local.pm
205 205 206 206 sub readonly { 207 207 my $self = shift; 208 return 1 if ( !-w $self->{filename} );208 return 1 if ( -e $self->{filename} && !-w $self->{filename} ); 209 209 } 210 210 211 211 sub browse_url_join {
comment:3 Changed 10 months ago by bowtie
from mj41
-
Padre/lib/Padre/File/Local.pm
205 205 206 206 sub readonly { 207 207 my $self = shift; 208 return 1 if ( !-w $self->{filename} );208 return 1 if ( -e $self->{filename} && !-w $self->{filename} ); 209 209 } 210 210 211 211 sub browse_url_join { -
Padre/lib/Padre/Wx/Main.pm
5391 5419 Wx::gettext("Do you really want to close and delete %s from disk?"), 5392 5420 $filename 5393 5421 ), 5422 Wx::gettext("Warning"), 5394 5423 Wx::YES_NO | Wx::CANCEL | Wx::CENTRE, 5395 5424 $self, 5396 5425 );
comment:4 Changed 10 months ago by bowtie
kevin@billy:~/src/Padre/Padre$ perl dev -t Padre::Wx::Main
# 1344705406.40055 Padre::Wx::Main::delete 'Deleting Padre::Document::Perl /home/kevin/workspace/Lama/stuff/deleteme.pl'
# 1344705406.40674 Padre::Wx::Main::close 'Closing Padre::Document::Perl /home/kevin/workspace/Lama/stuff/deleteme.pl'
this is around line 5136 with above patches applied
comment:5 Changed 10 months ago by mj41
patch -p1 -i 0001-Fix-delete-dialog.patch
patch -p1 -i 0002-File-is-not-readonly-if-doesn-t-exist.patch
patch -p1 -i 0003-Fix-whitespaces.patch
patch -p1 -i 0004-Fix-recreation-of-files-deleted-by-process-outside-o.patch
Changed 10 months ago by mj41
- Attachment 0004-Fix-recreation-of-files-deleted-by-process-outside-o.patch added
