[pve-devel] [PATCH v1 pve-common 10/18] pbsclient: use `File::Spec->catfile` to concatenate file paths

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 22 13:46:34 CET 2024


Am 21.11.24 um 17:17 schrieb Max Carrara:
> On Mon Nov 11, 2024 at 8:16 PM CET, Thomas Lamprecht wrote:
>> a commit message explaining why/benefits would be good – especially as IIRC
>> we currently do not use this module at all?
> 
> Sure, I'll add one!
> 
> I've opted to using `File::Spec` here because I've been using it a lot
> for other things (that haven't landed on the mailing list yet). The
> reasoning is mostly something like "oh there's a core module that
> handles concatenating paths and file names, I will use that instead of
> doing it by hand".
> 
> ... granted, this is maybe a little pedantic here; I mainly just thought
> it wouldn't hurt. But yes, I could've specified that in the commit
> message.

For perl this does not gives one much, but hides a bit what's happening,
IMO a bit of a lateral move, but it can be OK I guess.

And FWIW, File::Spec->join is an alias to catfile, and IMO would be a
bit easier to read, so if, I'd go for that variant.




More information about the pve-devel mailing list