Generating absolute path

View: New views
2 Messages — Rating Filter:   Alert me  

Generating absolute path

by Bernd Gutmann-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I need to find out the absolute path given a path, for instance

./myfile.pl  ==>> /dir1/dir2/myfile.pl
../otherfile.pl ==>> /dir1/otherfile.pl
./folder/file42.txt ==>>  /dir1/dir2/folder/file42.txt
...

I looked in the documentation of YAP, and found this predicate:

prolog_file_name(+Name,-FullPath )
Unify FullPath with the absolute path YAP would use to consult file  
Name.

However, YAP tells me that this predicate doesn't exist. And the  
documentation doesn't say that this predicate is in a library, so I  
assume it's built in and thus should be available.
I also ran find on the YAP source folder, but no file except yap.tex/
yap.pdf/yap.html contains the string "prolog_file_name".

Here are my questions:
Does prolog_file_name/2 really exist? If yes, will it do what I need?
If no, is there another way to get what I need?

I'm using the GIT version of Yap-5.1.4.


Kind Regards
Bernd


-------------------------------------------------------------------------------
Bernd Gutmann <Bernd.Gutmann@...>
Dept. of Computer Science
Katholieke Universiteit Leuven
Phone: +32 16 32 7576
Skype: kopoltra
http://www.cs.kuleuven.be/~bernd
-------------------------------------------------------------------------------

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html







------------------------------------------------------------------------------
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: Generating absolute path

by Vitor Santos Costa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bernd

It should exist, but it somehow disappeared when I was cleaning up the
file loading code.

I put it back where it is due in yap-6, and will transfer that to stable.

Thanks!

Vitor

PS: YAP will give you the name the system tells, which in NSF machines
or machines with symbolic links may be a bit of a surprise.

On Wed, Jun 24, 2009 at 2:44 PM, Bernd Gutmann<post@...> wrote:

> Hi.
>
> I need to find out the absolute path given a path, for instance
>
> ./myfile.pl  ==>> /dir1/dir2/myfile.pl
> ../otherfile.pl ==>> /dir1/otherfile.pl
> ./folder/file42.txt ==>>  /dir1/dir2/folder/file42.txt
> ...
>
> I looked in the documentation of YAP, and found this predicate:
>
> prolog_file_name(+Name,-FullPath )
> Unify FullPath with the absolute path YAP would use to consult file
> Name.
>
> However, YAP tells me that this predicate doesn't exist. And the
> documentation doesn't say that this predicate is in a library, so I
> assume it's built in and thus should be available.
> I also ran find on the YAP source folder, but no file except yap.tex/
> yap.pdf/yap.html contains the string "prolog_file_name".
>
> Here are my questions:
> Does prolog_file_name/2 really exist? If yes, will it do what I need?
> If no, is there another way to get what I need?
>
> I'm using the GIT version of Yap-5.1.4.
>
>
> Kind Regards
> Bernd
>
>
> -------------------------------------------------------------------------------
> Bernd Gutmann <Bernd.Gutmann@...>
> Dept. of Computer Science
> Katholieke Universiteit Leuven
> Phone: +32 16 32 7576
> Skype: kopoltra
> http://www.cs.kuleuven.be/~bernd
> -------------------------------------------------------------------------------
>
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Yap-users mailing list
> Yap-users@...
> https://lists.sourceforge.net/lists/listinfo/yap-users
>

------------------------------------------------------------------------------
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users