This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def root= new File('/usr/share') | |
def full= new File('/usr/share/docs/rpm-4.4') | |
// Print the relative path of 'full' in relation to 'root' | |
// Notice that the full path is passed as a parameter to the root. | |
def relPath= new File( root.toURI().relativize( full.toURI() ).toString() ) |