# File lib/fastcst/changeset.rb, line 342
342:         def ChangeSet.create_target_path(filename)
343:             path = File.split(filename)[0]
344:     
345:             if File.exist? path
346:                 # target path exists, but sometimes the target path is a file
347:                 # this doesn't get picked up by the delete operations so we delete it here
348:                 # and recreate the file as a directory for further operations
349:                 if not File.directory? path
350:                     UI.event :warn, "#{path} exists but is not a directory, deleting and recreating as a directory (will backup with ~ ending)"
351:                     # create a backup of the file with a ~ ending
352:                     FileUtils::mv(path, path +"~")
353:                     FileUtils::rm_rf(path)
354:                 
355:                     UI.event :create, "creating path: #{path}"
356:                     FileUtils::mkdir_p(path)
357:                 end
358:             else
359:                 UI.event :create, "creating path: #{path}"
360:                 FileUtils::mkdir_p(path)
361:             end
362:         end