[Gambas-user] Path specification

Gianluigi bagonergi at gmail.com
Sun Aug 19 12:43:11 CEST 2018


2018-08-19 11:47 GMT+02:00 Tobias Boege <taboege at gmail.com>:

> On Sat, 18 Aug 2018, Hans Lehmann wrote:
> > Hello Charlie,
> >
> > what is special about the following line with regard to the path
> > specification:
> >
> > Dim sFile As String = File.Load("../.project")
> >
> > ?
> >
>
> This is documented here: http://gambaswiki.org/wiki/cat/path
>
> A relative path starting with ".." references a data file in the
> currently running *project*, even if that code is executed from
> a component or library.
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>

Hi Tobias,
I find this explanation of the wiki unclear.
>From it, after compilation, it would seem that the concept of the "current
project" no longer exists.
But this simple code should work even after compilation, right?

Note: The file "foo.txt" is located inside the project data folder.

Public Sub Main()

  Dim sPath As String = "/tmp/path-test"

  Try Mkdir sPath
  If Error Then Return
  Try Copy "./foo.txt" To sPath &/ "foo.txt"

End

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180819/721cd37f/attachment.html>


More information about the User mailing list