<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head><body style="">
<div>
<br/>Mark Morgan Lloyd <markMLl.fpc-pascal@telemetry.co.uk> hat am 14. September 2012 um 15:18 geschrieben:
<br/>> Krzysztof wrote:
<br/>> > I just quicky googled not allowed characters and wrote this simple function:
<br/>> >
<br/>> > function IsValidFilename(const AFilename: String): Boolean;
<br/>> > var
<br/>> > c: set of Char = ['<','>',':','"','/','\','|','?','*', '%', '.'];
<br/>> > i: Integer;
<br/>> > begin
<br/>> > Result := True;
<br/>> > for i:=1 to Length(AFilename) do
<br/>> > if AFilename[i] in c then
<br/>> > Exit(False);
<br/>> > end;
<br/>> >
<br/>> > So, problem solved. Thanks and regards
<br/>>
<br/>> But several of those are fine in filenames- just inadvisable since they
<br/>> need special quoting/escaping to get past the shell. As does ' ' which
<br/>> isn't in your list :-)
<br/>
<br/>
</div>
<div>
And it does not check for #0..#31, #127.
</div>
<div>
</div>
<div>
</div>
<div>
Mattias
</div>
<div>
</div>
</body></html>