#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/Spezzare+un+percorso+di+un+file # Check the page for copyright notice and explanations >> file = "C:/Programmi/OpenOffice.org1.0.1/share/template/italian/internal/html.sxw" => "C:/Programmi/OpenOffice.org1.0.1/share/template/italian/internal/html.sxw" >> File.basename file => "html.sxw" >> File.dirname file => "C:/Programmi/OpenOffice.org1.0.1/share/template/italian/internal" >> File.extname file => ".sxw"