Monday, December 18, 2017

#51 2017-07-29 08:57:47 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2728
Website

Re: repair broken Finder aliases

msh wrote:


It's a shame that the source for AliasPath is not being shared.



It's not a secret and it's written in either (Objective-)C or Swift which has no purpose on MS here. StefanK just wrote a binary so you can use it. You want the code? Here is one of the thousand examples on how to resolve alias paths.

Last edited by DJ Bazzie Wazzie (2017-07-29 08:58:25 am)

Offline

 

#52 2017-07-29 09:10:06 am

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

DJ Bazzie Wazzie wrote:

It's not a secret and it's written in either (Objective-)C or Swift which has no purpose on MS here. StefanK just wrote a binary so you can use it. You want the code? Here is one of the thousand examples on how to resolve alias paths.



Ehm...I wanted the source to add it to MacPorts.

Offline

 

#53 2017-08-02 10:02:03 am

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

@StefanK, I just reran AliasPath and found two false positives, namely two aliases that are reported as broken but that actually work and whose 'Original' path in Get Info pane also is correct, but AliasPath gives what I think is a previous path were the target files where momentarily stored a long time ago. The only characteristics that make them stand out is their names being ~90 chars and the use of parens and plus in their names.

Offline

 

#54 2017-08-02 10:24:48 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: repair broken Finder aliases

Does the alias file name or the original file name contain the special characters?

I tried both but can't reproduce the issue.


regards

Stefan

Offline

 

#55 2017-08-02 01:11:47 pm

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

StefanK wrote:

Does the alias file name or the original file name contain the special characters?



Both.

Is there any way that you could be getting a path cached years ago?

Offline

 

#56 2017-08-02 01:23:00 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: repair broken Finder aliases

I don't think so.

AliasPath does a Spotlight search like mdfind and uses the same way to get the original path as the GitHub project.


regards

Stefan

Offline

 

#57 2017-08-02 01:27:09 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3203

Re: repair broken Finder aliases

msh wrote:
StefanK wrote:

Does the alias file name or the original file name contain the special characters?



Both.

Is there any way that you could be getting a path cached years ago?




What if you use the script posted in message #46? It use the original CLI so you will know if it report also false bad aliases.

Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) mercredi 2 aout 2017 20:26:52

Offline

 

#58 2017-08-02 02:48:15 pm

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

Yvan Koenig wrote:

What if you use the script posted in message #46? It use the original CLI so you will know if it report also false bad aliases.



Your script in #46 with the binary in #13 report both aliases as broken and give also the wrong, old original path.

However

Applescript:

tell application "Finder"
   exists original item of alias "path/to/file"
       --> true

returns that the original path exists, as it actually is.

Maybe it's a problem with the metadata store.

Offline

 

#59 2017-08-02 03:03:17 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: repair broken Finder aliases

I guess the Finder performs an extra step to resolve the alias which the CLI does not. It could be quite expensive for a large amount of files.

Last edited by StefanK (2017-08-02 03:04:10 pm)


regards

Stefan

Offline

 

#60 2017-08-03 03:40:22 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3203

Re: repair broken Finder aliases

@ msh

May you post the Hfs path of the two good aliases treated as bad ones ?

Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) jeudi 3 aout 2017 10:40:14

Offline

 

#61 2017-08-03 09:37:35 am

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

Yvan Koenig wrote:

@ msh May you post the Hfs path of the two good aliases treated as bad ones ?



"HD:Users:me:Work:company:to read:8 O045 SAM Service (L)-(Mode) Guide R10 ISSUE1.00.docx"

"HD:Users:me:Work:company:to read:4 035 LAS L2+ Service(Mode) R0 ISSUE2.00 (s+n).ppt"

These are company files, so I obfuscated the filenames but leaving spacing and special characters.

It could be it's MS warez. I tried adding the enclosing folder to Spotlight Preferences' Privacy list, then deleting it from there and Console immediately logged

mdworker32(6758) deny mach-lookup com.apple.PowerManagement.control (import fstype:hfs fsflag:480D000 flags:240000005E diag:0 uti:org.openxmlformats.presentationml.presentation plugin:/Library/Spotlight/Microsoft Office.mdimporter - find suspect file using: sudo mdutil -t 725374)



Can anyone try with some doc or ppt files?

Offline

 

#62 2017-08-03 10:39:18 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3203

Re: repair broken Finder aliases

@ msh

Thank you.
I see no special character in the file names so I'm always puzzled.

I assume that you have more than one docx file and more than one ppt one so although I dislike Merdosoft I don't think that there may be a link between this company and the problem.

Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) jeudi 3 aout 2017 17:39:13

Offline

 

#63 2017-08-06 07:08:47 am

msh
Member
Registered: 2014-01-25
Posts: 107

Re: repair broken Finder aliases

Yvan Koenig wrote:

I assume that you have more than one docx file and more than one ppt one so although I dislike Merdosoft I don't think that there may be a link between this company and the problem.



There seems to be a problem with the mdimporter and those files.

Fwiw, I rebuilt the metadata stores with `mdutil -E /` and still get those same false positives. Oh well…

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)