Opened 9 years ago

Closed 9 years ago

#6033 closed bug (invalid)

A symbolic link is broken in an info window when pointing to a volume root

Reported by: Karvjorm Owned by: anevilyak
Priority: normal Milestone: R1
Component: Kits/libtracker.so Version: R1/alpha2
Keywords: Symlink volume InfoWindow broken Cc: Karvjorm
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

I have here an example, how symbolic link to mimetype file that do not have default application, is broken. Source or error message is in src/kits/tracker/InfoWindow.cpp :

// Use the same method as used to resolve fIconModel, which handles
// both absolute and relative symlinks. if the link is broken, try to
// get a little more information.
if (model->IsSymLink()) {
	bool linked = false;

	Model resolvedModel(model->EntryRef(), true, true);
	if (resolvedModel.InitCheck() == B_OK) {
		// Get the path of the link
		BPath traversedPath;
		resolvedModel.GetPath(&traversedPath);

		// If the BPath is initialized, then check the file for existence
		if (traversedPath.InitCheck() == B_OK) {
			BEntry entry(traversedPath.Path(), false);	// look at the target itself
			if (entry.InitCheck() == B_OK && entry.Exists())
				linked = true;
		}
	}

	// always show the target as it is: absolute or relative!
	BSymLink symLink(model->EntryRef());
	char linkToPath[B_PATH_NAME_LENGTH];
	symLink.ReadLink(linkToPath, B_PATH_NAME_LENGTH);
	fLinkToStr = linkToPath;
	if (!linked)
		fLinkToStr += " (broken)";	// link points to missing object

I suppose that problem is with that Model.cpp file. Symbolic link points to location that is volume and symbolic link at the same time. But it is only my guess.

Attachments (2)

getinfobrokenlink.png (61.6 KB ) - added by Karvjorm 9 years ago.
A general view with infowindow hint and target in terminal window
getinfo_broken_link.png (31.2 KB ) - added by Karvjorm 9 years ago.
Infowindow with the broken hint error message opened

Download all attachments as: .zip

Change History (6)

by Karvjorm, 9 years ago

Attachment: getinfobrokenlink.png added

A general view with infowindow hint and target in terminal window

by Karvjorm, 9 years ago

Attachment: getinfo_broken_link.png added

Infowindow with the broken hint error message opened

comment:1 by Karvjorm, 9 years ago

I debugged this bug myself and noticed that when symlink is broken, then "if (resolvedModel.InitCheck() == B_OK)" is false.

But after trying to repeat error (by removing faulty link and creating it again) I think that the problem is the command line buffer of the terminal window. It is too prone to errors. Even when you think you are typing correct command it still can be wrong.

This bug is probably a terminal window problem and is not reproducible. But if you type the link wrong you will get the same kind of broken link. Therefore, it is better to mark this bug invalid.

We should have a new add-ons to create symbolic links. It could be the better solution than command line commands.

comment:2 by anevilyak, 9 years ago

You realize you can already create a link via either tracker's right click context menu or by right click dragging an object and picking "Create Link Here", yes?

in reply to:  2 comment:3 by Karvjorm, 9 years ago

Replying to anevilyak:

You realize you can already create a link via either tracker's right click context menu or by right click dragging an object and picking "Create Link Here", yes?

No, I did not know those tips. Used only old linux command line tricks. I tried to create symlink when hovering mouse cursor over the Desktop, but could not find any way to do it.

comment:4 by anevilyak, 9 years ago

Resolution: invalid
Status: newclosed

If you right click on the object you want as the link target, there is a submenu for creating a link which indicates the destination for where the link should be placed. Alternatively if you right click drag the object, you can indicate creating a link to it wherever you drop it. Closing this ticket as invalid in any case.

Note: See TracTickets for help on using tickets.