Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-30 Thread Bart via lazarus
On Wed, Oct 30, 2019 at 11:42 AM Bo Berglund via lazarus wrote: > >Windows knows specials paths starting with '\\'. > > But I don't! :( > What is special with these? \\?\C:\foo\bar\..\.. is not the same path as C:\foo\bar\..\.. (which basically is C:\) If a path starts with \\?\ like above,

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-30 Thread Mattias Gaertner via lazarus
On Tue, 29 Oct 2019 13:07:50 +0100 Bo Berglund via lazarus wrote: >[...] > Anyway, given that the delimiters do not matter I will just code for > Linux (the main platform) and not bother with the Windows case. There are some differences. For example filenames are case insensitive. FileExists

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Sven Barth via lazarus
Graeme Geldenhuys via lazarus schrieb am Di., 29. Okt. 2019, 21:08: > On 29/10/2019 12:07 pm, Bo Berglund via lazarus wrote: > > I have been around too long so I > > remember the old days... > > Same. Windows should get with the times and switch to Unix. ;-) > > On a side note: > After all,

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Graeme Geldenhuys via lazarus
On 29/10/2019 9:16 pm, Michael Thompson wrote: > Been doing this for 10 years now, no conflict on any client PC > anywhere :-) I like those holes in A: and B: :-D Very clever indeed! Make full use of those relics. I wonder why Microsoft didn't think of that for USB drives. Regards, Graeme --

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread DougC via lazarus
For me A: isĀ  always my archives and B: is my regular backup. Easy to remember! On Tue, 29 Oct 2019 17:16:56 -0400 Michael Thompson via lazarus wrote > maybe they could start from A: N :-) I work offshore for a variety of

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Michael Thompson via lazarus
> maybe they could start from A: N :-) I work offshore for a variety of clients, and using their PCs. I always ensure my USB key mount at B: (so I don't have to tweak paths in my fpc and Lazarus installs), I code in an encrypted folder that I mount at A: (using Veracrypt). The encrypted

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Marco van de Voort via lazarus
Op 2019-10-29 om 21:08 schreef Graeme Geldenhuys via lazarus: On 29/10/2019 12:07 pm, Bo Berglund via lazarus wrote: I have been around too long so I remember the old days... Most of the people I work with have NO idea why Windows starts with C: as the boot drive instead of A: :-P I'm already

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Graeme Geldenhuys via lazarus
On 29/10/2019 12:07 pm, Bo Berglund via lazarus wrote: > I have been around too long so I > remember the old days... Same. Windows should get with the times and switch to Unix. ;-) On a side note: After all, Windows still start the drive letters with C: and considering that no PC is the last

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Michael Van Canneyt via lazarus
On Tue, 29 Oct 2019, Bo Berglund via lazarus wrote: On Tue, 29 Oct 2019 12:43:51 +0100 (CET), Michael Van Canneyt via lazarus wrote: 1. Don't hardcode '/' or '\', use the PathDelim constant instead. You will not need any ifdefs. The whole thing is that paths might be read from config

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Bo Berglund via lazarus
On Tue, 29 Oct 2019 12:43:51 +0100 (CET), Michael Van Canneyt via lazarus wrote: >1. Don't hardcode '/' or '\', use the PathDelim constant instead. >You will not need any ifdefs. The whole thing is that paths might be read from config or other data files and so they will come in either with

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Bo Berglund via lazarus
On Tue, 29 Oct 2019 14:32:18 +0300, Mehmet Erol Sanliturk via lazarus wrote: >In Windows XP , it is possible to use "/" instead of "\" . Therefore , it >is NOT necessary to make two different file path representations . I am not >using any Windows now , therefore I can not say anything about

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Michael Van Canneyt via lazarus
On Tue, 29 Oct 2019, Bo Berglund via lazarus wrote: I am writing a console application intended to be portable between Windows and Linux and it uses files on the file system for configuration and also for processing data. Since the path delimiter is different on Unix and Windows I believe I

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Mehmet Erol Sanliturk via lazarus
In Windows XP , it is possible to use "/" instead of "\" . Therefore , it is NOT necessary to make two different file path representations . I am not using any Windows now , therefore I can not say anything about last Windows versions . It is very easy to check whether "/" is usable on your

Re: [Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Carlos E. R. via lazarus
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 29/10/2019 12.25, Bo Berglund via lazarus wrote: > I am writing a console application intended to be portable between > Windows and Linux and it uses files on the file system for > configuration and also for processing data. > > Since the path

[Lazarus] Multi-platform console application, how to handle file paths?

2019-10-29 Thread Bo Berglund via lazarus
I am writing a console application intended to be portable between Windows and Linux and it uses files on the file system for configuration and also for processing data. Since the path delimiter is different on Unix and Windows I believe I have to handle this in my code, but how? I could create