Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#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 (5)

Main.pm.patch (1.7 KB) - added by bowtie 2 years ago.
0001-Fix-delete-dialog.patch (664 bytes) - added by mj41 2 years ago.
0002-File-is-not-readonly-if-doesn-t-exist.patch (788 bytes) - added by mj41 2 years ago.
0003-Fix-whitespaces.patch (996 bytes) - added by mj41 2 years ago.
0004-Fix-recreation-of-files-deleted-by-process-outside-o.patch (1.0 KB) - added by mj41 2 years ago.

Download all attachments as: .zip

Change History (13)

Changed 2 years ago by bowtie

comment:1 Changed 2 years 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 2 years ago by bowtie

from mj41

  • Padre/lib/Padre/File/Local.pm

     
    205205 
    206206sub readonly { 
    207207 my $self = shift; 
    208  return 1 if ( !-w $self->{filename} ); 
     208 return 1 if ( -e $self->{filename} && !-w $self->{filename} ); 
    209209} 
    210210 
    211211sub browse_url_join { 

comment:3 Changed 2 years ago by bowtie

from mj41

  • Padre/lib/Padre/File/Local.pm

     
    205205 
    206206sub readonly { 
    207207 my $self = shift; 
    208  return 1 if ( !-w $self->{filename} ); 
     208 return 1 if ( -e $self->{filename} && !-w $self->{filename} ); 
    209209} 
    210210 
    211211sub browse_url_join { 
  • Padre/lib/Padre/Wx/Main.pm

     
    53915419 Wx::gettext("Do you really want to close and delete %s from disk?"), 
    53925420 $filename 
    53935421 ), 
     5422 Wx::gettext("Warning"), 
    53945423 Wx::YES_NO | Wx::CANCEL | Wx::CENTRE, 
    53955424 $self, 
    53965425 ); 

comment:4 Changed 2 years 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 2 years 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 2 years ago by mj41

Changed 2 years ago by mj41

comment:6 Changed 2 years ago by bowtie

  • Resolution set to fixed
  • Status changed from new to closed

comment:7 Changed 2 years ago by bowtie

  • Component changed from not classified yet to editor

comment:8 Changed 2 years ago by bowtie

Checkin created revision r19177

Note: See TracTickets for help on using tickets.