Products > Computers

why does GNU/Nano always have to access files via the abs path?

(1/2) > >>

DiTBho:
so today I noticed this strange thing via strace-like tool.

--- Code: ---# nano test.txt

--- End code ---

--- Code: ---...
accessing "/home/DiTBho/exp14/test.txt"
...

--- End code ---

--- Code: ---open [/etc/ld.so.cache] ... as ??? flags=0x00088000
open [/lib/libncursesw.so.6] ... as ??? flags=0x00088000
open [/lib/libtinfow.so.6] ... as ??? flags=0x00088000
open [/lib/libc.so.6] ... as ??? flags=0x00088000
open [/usr/lib/locale/locale-archive] ... as ??? flags=0x00088000
open [/etc/terminfo/x/xterm] ... as ??? flags=0x00008000
open [/etc/nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano] ... as ??? flags=0x00098800
open [/usr/lib/gconv/gconv-modules.cache] ... as read
open [/usr/share/nano/ada.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/asm.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/autoconf.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/awk.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/c.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/changelog.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/cmake.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/css.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/default.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/elisp.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/email.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/fortran.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/gentoo.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/go.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/groff.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/guile.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/haskell.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/html.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/java.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/javascript.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/json.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/lua.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/makefile.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/man.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/markdown.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/nanohelp.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/nanorc.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/nftables.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/objc.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/ocaml.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/patch.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/perl.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/php.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/po.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/povray.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/python.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/ruby.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/rust.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/sh.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/spec.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/sql.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/tcl.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/tex.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/texinfo.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/xml.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/yaml.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/html.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/python.nanorc] ... as ??? flags=0x00008000
open [/usr/share/nano/sh.nanorc] ... as ??? flags=0x00008000
open [/etc/nsswitch.conf] ... as ??? flags=0x00080000
open [/etc/passwd] ... as ??? flags=0x00080000
open [/home/DiTBho/exp14/test.txt] ... as ??? flags=0x00008000
open [/usr/share/locale/locale.alias] ... as ??? flags=0x00080000
open [/usr/share/locale/C.UTF8/LC_MESSAGES/nano.mo] ... as read
open [/usr/share/locale/C.utf8/LC_MESSAGES/nano.mo] ... as read
open [/usr/share/locale/C/LC_MESSAGES/nano.mo] ... as read
open [/usr/share/nano/default.nanorc] ... as ??? flags=0x00008000

--- End code ---

Does it make sense?  :-//

it seems it's not an option you can change by editing /etc/nanorc or something.

ataradov:
Nano source code is less than 20 files. And only one obviously named (files.c) deals with files. You can just look at what it does. For any file name operation it calls get_full_path() to create a canonical version of the file  name. There is no option for this.

abeyer:
This sounds as likely to be an artifact of the tool you're using, as it is to be related to nano... but you don't actually tell us what tool, or why you even think this wouldn't be expected, or what you think you could do about a tracing tool's output from your nanorc.

ataradov:
How is this a tool artifact when the nano is coded to use full paths? Why they did it this way is up to them, I doubt there is a real way to find that out.

DiTBho:

--- Quote from: ataradov on May 29, 2024, 07:07:31 pm ---For any file name operation it calls get_full_path() to create a canonical version of the file name.
There is no option for this.

--- End quote ---

I asked if this makes sense!!! Does it? and if so why?
Going to hack it, because e.g { vi, vim, neovim, joe } don't do that.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod