Version: v0.8.1 - Beta.  We welcome contributors & feedback.

File.withFileBase

$file.withFileBase($newFileBase) -> $newPath

Description

Create a new file path from the current file, with a new file base name (the filename without the extension).

$origFile = file'files:/dir/data.txt'

$tempFile = $origFile.withFileBase('temp')
//= file'files:/dir/temp.txt'
                    ^^^^

See Also