Boost logo

Boost :

Subject: Re: [boost] [filesystem] Decomposition of filenames beginning with period?
From: Vicente BOTET (vicente.botet_at_[hidden])
Date: 2011-04-07 11:43:16


> Message du 07/04/11 17:15
> De : "Beman Dawes"
> A : "Boost Developers List"
> Copie à :
> Objet : [boost] [filesystem] Decomposition of filenames beginning withperiod?
>
> Boost.Filesystem class path views filenames as being made up of a stem
> and an extension.
>
> My Windows Users directory includes files ".gitconfig" and ".netrc".
>
> The current class path implementation views these as having extensions
> of ".gitconfig" and ".netrc", respectively, and empty stems.
>
> To me, that's a bit counter intuitive. I guess I view filenames as
> always having stems, but extensions being optional. But I don't view
> that as a strong enough argument to change anything.
>
> Does anyone have a stronger argument than intuition for changing or
> retaining the current behavior?
>
Hi,

We can define stem and extension in different ways:
1 - stem can be empty, and extension is the part after the last dot.
2 - stem can not be empty, and extension is the part after the last dot after the first character (ensures stem it is not empty) or the part after the first dot after the first character.
3 - stem and extension are not empty and have a sens only when the filename follows the pattern "stem"."extension". For all the other stem and extension is undefined (an exception cn be throw in this cases).

Note that there are other files (. and ..) which have not evident stem or extension. Have you considered the 3rd alternative?

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk