diff --git a/lib/sup/mode.rb b/lib/sup/mode.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/mode.rb
+++ b/lib/sup/mode.rb
@@ -83,6 +83,7 @@ EOS
 ### helper functions
 
   def save_to_file fn, talk=true
+    FileUtils.mkdir_p File.dirname(fn)
     if File.exist? fn
       unless BufferManager.ask_yes_or_no "File \"#{fn}\" exists. Overwrite?"
         info "Not overwriting #{fn}"
Create directory for saving files if it doesn't exist yet