Re: [fpc-pascal] ExtractRelativePath() not always returning expected result
>Can you please file a bugreport for that, so I will not forget it ? Done. >The default for the OS is used; This is by design. That makes sense for most cases but is there / could there be a way to override this? I normally write programs for Windows, however I've had to write out the Linux Slashes on my windows system before. An example is writing out a playlist files, and if I use the linux / the file would be useable on both windows and linux, but if I use the windows \ it only worked on windows. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] ExtractRelativePath() not always returning expected result
On Thu, 24 Aug 2017, James Richters wrote: You must make sure directories are appended with / Thank you, I just tried that and now I get the expected results: both / and \ work From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" From "/pp/bin/win32/ppc386/" to "/pp/src/compiler/" via "..\..\..\src\compiler\" From "e:/pp/bin/win32/ppc386/" to "d:/pp/src/compiler/" via "d:/pp/src/compiler/" From "e:\pp\bin\win32\ppc386/" to "d:\pp\src\compiler/" via "d:\pp\src\compiler/" From "C:\FPC\3.0.2\" to "C:\FPC\3.0.2\" via "" From "C:\FPC\3.0.2\" to "C:\FPC\3.0.4rc1\" via "..\3.0.4rc1\" From "Q:\" to "Q:\FPC\3.0.4rc1\" via "FPC\3.0.4rc1\" I guess the example program should have the trailing / in the examples to make it clear they are needed. None of the sample test cases have trailing / or \ Can you please file a bugreport for that, so I will not forget it ? I am curious about this though: From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" Shouldn't the output use / since / was used in both the source and destination not \ ? The default for the OS is used; This is by design. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] ExtractRelativePath() not always returning expected result
>You must make sure directories are appended with / Thank you, I just tried that and now I get the expected results: both / and \ work From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" From "/pp/bin/win32/ppc386/" to "/pp/src/compiler/" via "..\..\..\src\compiler\" From "e:/pp/bin/win32/ppc386/" to "d:/pp/src/compiler/" via "d:/pp/src/compiler/" From "e:\pp\bin\win32\ppc386/" to "d:\pp\src\compiler/" via "d:\pp\src\compiler/" From "C:\FPC\3.0.2\" to "C:\FPC\3.0.2\" via "" From "C:\FPC\3.0.2\" to "C:\FPC\3.0.4rc1\" via "..\3.0.4rc1\" From "Q:\" to "Q:\FPC\3.0.4rc1\" via "FPC\3.0.4rc1\" I guess the example program should have the trailing / in the examples to make it clear they are needed. None of the sample test cases have trailing / or \ I am curious about this though: From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" Shouldn't the output use / since / was used in both the source and destination not \ ? James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] ExtractRelativePath() not always returning expected result
On Thu, 24 Aug 2017, James Richters wrote: I’m trying to figure out ExtractRelativePath() and I’ve run the sample program found here: https://www.freepascal.org/docs-html/rtl/sysutils/extractrelativepath.html I get the following results from the sample (with a few test I threw in myself): From "/pp/src/compiler" to "/pp/bin/win32/ppc386" via "..\bin\win32\ppc386" // Shouldn’t this be “..\..\bin\win32\ppc386” ? You must make sure directories are appended with / Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] ExtractRelativePath() not always returning expected result
I’m trying to figure out ExtractRelativePath() and I’ve run the sample program found here: https://www.freepascal.org/docs-html/rtl/sysutils/extractrelativepath.html I get the following results from the sample (with a few test I threw in myself): >From "/pp/src/compiler" to "/pp/bin/win32/ppc386" via "..\bin\win32\ppc386" >// Shouldn’t this be “..\..\bin\win32\ppc386” ? >From "/pp/bin/win32/ppc386" to "/pp/src/compiler" via "..\..\src\compiler" > // Shouldn’t this be "..\..\..\src\compiler" ? >From "e:/pp/bin/win32/ppc386" to "d:/pp/src/compiler" via "d:/pp/src/compiler" >//Expected >From "e:\pp\bin\win32\ppc386" to "d:\pp\src\compiler" via "d:\pp\src\compiler" >//Expected >From "C:\FPC\3.0.2" to "C:\FPC\3.0.2" via "3.0.2" > // Shouldn’t this be “” since we are already >there? >From "C:\FPC\3.0.2" to "C:\FPC\3.0.4rc1" via "3.0.4rc1" > // Shouldn’t this be "..\3.0.4rc1"? >From "Q:\" to "Q:\FPC\3.0.4rc1" via "FPC\3.0.4rc1" > //Expected Am I missing something here? James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal