[fpc-pascal] Function for checking correct file name

Peter peter at pblackman.plus.com
Thu Sep 20 21:36:26 CEST 2012


On 12/09/12 19:51, Krzysztof wrote:
> Hi,
>
> Exists any multiplatform function which check if string contains not
> allowed characters (like<  >  / \ on windows) for filename?
>
> Regards
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

No!  File name & path validity are platform specific.

Jurgen's idea of attempting to create a temporary file with the given 
name, probably best solution.
Also it will check write access to the path, which is useful too. And it 
is future proof.
Need to run the check on the target of course.

Regards,
PB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120920/85664dfb/attachment.html>


More information about the fpc-pascal mailing list