On 9/7/13, Jürgen Hestermann <juergen.hesterm...@gmx.de> 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 if this '\\?\' prefix is hidden away from the > programmer at all. File names should be just that: File names. On windows > *every* API function that expects file names should be prepended with '\\?\' > internally 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, dots, '/' etc, because these are illegal characters in a filename on Windows. This is especially a problem with Lazarus (the IDE itself), where config files and include directives may contain '/', or are defined as relative paths. You would also not be able to open files with a relative path: FileExists('foo\bar.txt') wil then internally be translated to "Ask the WinApi if '\\?\foo\bar.txt' exists", and this will fail, since the '\\?\' scheme needs a fully qualified path. (And in a threaded program you may not want to call ExpandFilename(), since on Windows this is not threadsafe). Bart _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal