From: David Stanford Date: 2009-02-04T02:59:42+09:00 Subject: File.delete one-liner Hi guys, I'm looking for a single line that essentially deletes the lockfile argument passed to the unlock method, or deletes the instance variable (default) lockfile. Like this, but simpler: @lockfile = some_other_lockfile def self.unlock(lockfile) if File.exist?(lockfile) File.delete(lockfile) else File.delete(@lockfile) end end I was thinking of something along the following: @lockfile = some_other_lockfile def self.unlock File.delete(lockfile) || File.delete(@lockfile) end ...however, the File.delete method doesn't return a true/false value based on its success. Any tips? Thanks in advance! -David -- Posted via http://www.ruby-forum.com/.