Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Mattias Gaertner
>[...] > This is especially a problem with Lazarus (the IDE itself), where > config files and include directives may contain '/', or are defined as > relative paths. Filenames from other platforms have to be converted by the application (here: Lazarus IDE) before passing them to RTL file function

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Bart
On 9/7/13, Jürgen Hestermann wrote: > Of course! Why the hell should there be double pathdelims? And why > (silently) accept them as if they were one? There should not be, but (history: DOS and) WinApi accept them, so the are NOT illegal in normal filenames. > '/' etc, because these are illega

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Jürgen Hestermann
Am 2013-09-07 18:49, schrieb Bart: > That would be wrong. > Prepending wiht '\\?\ means that everything should be taken literally, > so trying to open/read etc. through WinApi will fail if filename > contains double pathedlims, Of course! Why the hell should there be double pathdelims? And why (s

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Bart
On 9/7/13, Jürgen Hestermann wrote: > Am 2013-09-07 12:52, schrieb Bart: > > > Note that '//?/C:/foo/bar' in contrast happily opens 'C:\foo\bar' > > (nice touch from M$). > > Why is this a "nice touch"? IMO it is crap. You missed the intended sarcasme sign. ;-) > > In general I would prefer

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Jürgen Hestermann
Am 2013-09-07 18:07, schrieb Sven Barth: > The "\\?\" paths don't support relative paths Then relative paths need to be expanded internally before use. If I have a deeply nested directory structure with paths longer than 255 characters then relative paths should work the same as when having sho

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Sven Barth
Am 07.09.2013 16:19 schrieb "Jürgen Hestermann" : > > My question is: should DoDirSeparators handle this case and leave the > > filename untouched if it starts with '\\?\', or should we leave it up > > to the programmer not calling functions like ExpandFilename if a > > filename starts with '\\?\'

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Jürgen Hestermann
Am 2013-09-07 12:52, schrieb Bart: > Note that '//?/C:/foo/bar' in contrast happily opens 'C:\foo\bar' > (nice touch from M$). Why is this a "nice touch"? IMO it is crap. This kind of inconsistencies in MS programs lead to false assumptions and mislead the user (programmer). If characters are

[fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-07 Thread Bart
Hi, This is a folowup off a discussion in LazarusDev mailinglist. It concerns "sanitizing" filenames on the Windows platform. The Windows API for handling filenames in most cases happily accepts filenames that have '/' in them. It treats '/' as a pathdelimiter. It also is very forgiving in using

[fpc-pascal] Re: Database parameter trouble in insert query

2013-09-07 Thread Reinier Olislagers
On 07/09/2013 09:22, Reinier Olislagers wrote: > Then looping over the set, I execute it. I thought AssignFromField may > be appropriate: > for i := 0 to Source.Fields.Count - 1 do > begin > InsertQuery.Params[i].Clear; > InsertQuery.Params[i].AssignFromField(Source.Fields[i]); > end; > InsertQ

[fpc-pascal] Database parameter trouble in insert query

2013-09-07 Thread Reinier Olislagers
An application needs to dump output into a (file-based for now) database (like MS Access, Firebird embedded, sqlite), Excel, CSV file etc. FPC trunk, x86 and x64, Windows (for now), Linux,... I've got the create database/create table functionality working but am hitting some issues copying dataset