From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Thu, 13 Sep 2007 18:34:49 -0700 Subject: [sup-talk] draft files aren't deleted when a draft message is deleted in the inbox In-Reply-To: <1189654538-sup-114@mona> References: <1189654538-sup-114@mona> Message-ID: <1189733596-sup-2790@south> Excerpts from jeff.covey's message of Wed Sep 12 20:38:39 -0700 2007: > i postponed a message and decided later not to finish it. it was in > my inbox with a "draft" label. i hit "d", and it disappeared from the > inbox, but ~/.sup/drafts/0 is still there with its contents. Interesting. Are there weird permissions on that directory, that would otherwise preclude you from deleting a file? Can you apply this diagnostic patch and post the "XX" log messages, please? Index: lib/sup/draft.rb =================================================================== --- lib/sup/draft.rb (revision 566) +++ lib/sup/draft.rb (working copy) @@ -35,7 +35,19 @@ raise ArgumentError, "can't find entry for draft: #{mid.inspect}" unless entry raise ArgumentError, "not a draft: source id #{entry[:source_id].inspect}, should be #{DraftManager.source_id.inspect} for #{mid.inspect} / docno #{docid}" unless entry[:source_id].to_i == DraftManager.source_id Index.drop_entry docid - File.delete @source.fn_for_offset(entry[:source_info]) + + fn = @source.fn_for_offset(entry[:source_info]) + Redwood::log "XX about to delete: #{fn}" + rv = + begin + File.delete fn + rescue Exception => e + Redwood::log "XX exception (e.class): #{e.message}" + nil + end + Redwood::log "XX deletion had return value #{rv.inspect}" + Redwood::log "XX file still there? #{File.exists? fn}" + UpdateManager.relay self, :delete, mid end end -- William