The officially official Devuan Forum!

You are not logged in.

#1 2018-05-30 18:17:21

GNUser
Member
Registered: 2017-03-16
Posts: 397  

what is the difference between ./ and ././ [SOLVED]

I've been hacking on GNU/Linux for a long time, so obviously I'm familiar with ./ and use it often. It seems that ././ is also sometimes used to mean "here" (for example, see the No hard-coded paths section here).

Have you ever encountered ././ before? I have only ever seen it in the AppImage guide in the link above. Please, what's the difference between ./ and ././? Internet searches have not turned up anything even remotely relevant this question.

Last edited by GNUser (2018-05-30 19:20:12)

Offline

#2 2018-05-30 18:36:47

golinux
Administrator
Registered: 2016-11-25
Posts: 1,250  

Re: what is the difference between ./ and ././ [SOLVED]

I have often used something similar ../ or even .../ in web design to navigate to various files in the tree structure of a complicated site.  Is ././ in a path to a file?  Or within some code?

Online

#3 2018-05-30 18:44:23

GNUser
Member
Registered: 2017-03-16
Posts: 397  

Re: what is the difference between ./ and ././ [SOLVED]

Yes, ././ in the context of AppImage creation are the leading characters in a relative path and means "here". I can confirm that it works:

bruno@thinkpad:~$ cd /bin
bruno@thinkpad:/bin$ ././echo test
test
bruno@thinkpad:/bin$ 

But for the life of me I can't figure out why someone wouldn't simply use plain ol' ./. Maybe the AppImage guys are unaware that the simpler form is equivalent? Maybe ././ also works in other OSes but ./ only works in GNU/Linux? I'm at a loss.

If none of my Devuan friends know, I may contact the AppImage guys to ask them.

Last edited by GNUser (2018-05-30 18:47:57)

Offline

#4 2018-05-30 19:19:50

GNUser
Member
Registered: 2017-03-16
Posts: 397  

Re: what is the difference between ./ and ././ [SOLVED]

I asked the AppImage guys and they explained it to me: https://github.com/AppImage/AppImageKit … -393284213

In a word, ././ is redundant. It's a hack to convert absolute paths (e.g., /usr/bin/foo) to relative paths (e.g., ././/bin/foo) without changing the length of the string. Binaries have internal addresses, so if the length of a string inside a binary is changed when patching the binary to make it portable, the binary will no longer work because things will no longer be at the expected addresses.

Last edited by GNUser (2018-05-31 18:29:39)

Offline

#5 2018-05-30 20:13:43

golinux
Administrator
Registered: 2016-11-25
Posts: 1,250  

Re: what is the difference between ./ and ././ [SOLVED]

It's not at all obvious to me . . .

Online

Board footer