14

I was looking in my "Recent" places in Nautilus and saw a folder named ..

Dot folder

My understanding is that a folder of the name . represents the current directory and is not an actual folder. I checked the properties of this folder:

Dot properties

There don't seem to be hidden characters in the name (like space-dot-space). The folder is in /usr/local/bin and has 4,728 items in it.

In fact /usr/local/bin has 16,512 items in it, so it can't be that (ie. the same folder as it is in).

If I open this folder by double-clicking it, it seems to be really arduino-1.6.9 (ie. its name isn't really .).

arduino-1.6.9 folder

If I do ls -la of /usr/local/bin I see (amongst other things):

nick:/usr/local/bin$ ls -la
total 156928
drwxrwxr-x  7 root nick     4096 Oct  5 14:55 .
drwxr-xr-x 11 root root     4096 Apr 10  2015 ..
drwxr-xr-x 11 nick nick     4096 May 10 19:18 arduino-1.6.9

My question is: how come the folder /usr/local/bin/arduino-1.6.9 is showing up in the "Recent" list as .?


This is Ubuntu 14.04 LTS 64-bit.


Can you find the reference to /usr/local/bin there and tell us what it says ?

There seem to be a few entries along these lines:

  <bookmark href="file:///usr/local/bin/arduino-1.6.9/." added="2016-10-10T19:50:11Z" modified="2016-10-10T19:50:11Z" visited="2016-10-10T19:50:11Z">
    <info>
      <metadata owner="http://freedesktop.org">
        <mime:mime-type type="text/plain"/>
        <bookmark:groups>
          <bookmark:group>geany</bookmark:group>
        </bookmark:groups>
        <bookmark:applications>
          <bookmark:application name="geany" exec="&apos;geany %u&apos;" modified="2016-10-10T19:50:11Z" count="1"/>
        </bookmark:applications>
      </metadata>
    </info>
  </bookmark>
  • 4
    very curious question. I'd say it's a bug in nautilus. What about ~/.local/share/recently-used.xbel file ? That's where recently stored files are saved. Can you find the reference to /usr/local/bin there and tell us what it says ? – Sergiy Kolodyazhnyy Oct 12 '16 at 6:49
  • See amended question. If this is the offending entry, I would expect it (Nautilus) to drop the /. part and show the next level up. – Nick Gammon Oct 12 '16 at 7:12
  • 1
    it appears to be the entry, however it's supposed to only deal with files, not directories ( in other words, it is not supposed to drop the /. part ) More important question is why did it appear on the recent list, because it's not supposed to. It also shows that it came from geany IDE, so my guess is that you tried to open that folder in geany, and it reported it as recent file – Sergiy Kolodyazhnyy Oct 12 '16 at 7:28
  • Yes, I may well have opened that folder, but surely in Geany the folder would open in the open file dialog, and shown me the contents. Geany is a text editor, not a folder editor. I don't see how it is useful for Nautilus to say that . was a recent folder. You may as well say that of every folder. – Nick Gammon Oct 12 '16 at 7:37
  • When I double-click the folder named . in Nautilus, and I get /usr/local/bin then surely that is the name that should appear on the folder? (Or maybe just bin) – Nick Gammon Oct 12 '16 at 7:40
1

I would say that the problem here is a bug in Geany, which is responsible for populating your recent files list with the faulty entry. It should be using a 'real path' instead of a path with . in it when creating these entries.

https://github.com/geany/geany/blob/12b9f27a795f7ec8c1faf6c225314a09b6c5f7af/src/ui_utils.c

I can't see where your . filepath would have come from. I tried opening a file in Geany, and the new entry in ~/.local/share/recently-used.xbel that appeared had the correct filename there, not a .. But if there is some use-case where you can open a directory in Geany, then that could be how you ended up with this entry in your recently-used file list. I would simply remove the whole chunk for the recently-used file list (or delete the file completely and restart, I can't imagine that would cause problems)

  • Yes, but Geany put the whole file name there as you can see from the quoted excerpt from the recently-used.xbel. The problem is not manifesting itself in Geany but in the Nautilus file browser. – Nick Gammon Nov 13 '16 at 3:42
  • I see the file name in your .xbel file as file:///usr/local/bin/arduino-1.6.9/.", so the final part of the pathname is '.', and that is what you are having rendered in Nautilus as the 'name' of the recent folder -- the last component of the path. This problem could be fixed in either Nautilus or Geany, but I tend to point the finger at Geany... – jdpipe Nov 13 '16 at 7:24
  • To show that Nautilus is capable of doing the right thing, I suggest removing the /. from the .xbel file and restarting Nautilus. I expect that the recent entry will then change to the expected behaviour, it will show up as arduino-1.6.9. – jdpipe Nov 13 '16 at 7:28
  • I can add, though, that it is expected that URIs can include 'dot-segments' so we can argue that Nautilus should be able to swallow them... tools.ietf.org/html/rfc3986#section-5.2.4 – jdpipe Nov 13 '16 at 7:34
  • It's a bug in both programs, but Geany started it. Nautilus should be able to resolve paths with superfluous paths in them but it can't, which is also a bug. – Kristopher Ives Nov 27 '16 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.