View Issue Details

IDProjectCategoryView StatusLast Update
0005548MMW 5FileMonitor / Find Missingpublic2023-10-23 21:20
Reporterpeke Assigned To 
PriorityurgentSeverityfeatureReproducibilityN/A
Status feedbackResolutionreopened 
Target Version5.2 
Summary0005548: Abandon handling Mapped Drives and force UNC Naming
DescriptionWe should consider to use UNC path and abandon Handling mapped drives

Delphi have function to check if file is on mapped drive or not

function ExpandUNCFileName(const S: FileName): string;

That will solve all mapped drive issues we have from time to time.

Function would be called for each new drive letter that is scanned and in case it is network share it will replace all subsequntial file scans from same drive with network share info.

Steps To ReproduceTicket:
CJZ-616077
GSW-368813
Additional InformationExample code:
Function checkifmapped(const drive : string; var uncpath :string):boolean;
begin
  result := false;
  uncpath := ExpandUNCFileName(drive);
  if uncpath[1] = '\' then
    result := true
  else
    result := false;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  unclink : string;
begin
  If checkifmapped( 'Z:' , unclink) then
    Label1.Caption := 'UNC Path: '+unclink
  Else
    Label1.Caption := 'Local Path: '+unclink;
end;
TagsNo tags attached.
Fixed in build

Relationships

related to 0008863 closedLudek MMW v4 FileMonitor: 'Remove missing items' deletes files if network tracks are inaccessible 
parent of 0008908 resolvedpeke MMW v4 Mapped Drive handling regression in MM4 (?) 
related to 0010725 closedLudek MMW v4 Network: Navigating, Network Shares is too slow, confusing and outdated 
related to 0015183 confirmedpeke MMW 5 MM5 > MMS migration wizard and issues 
related to 0016870 closedLudek MMW 5 iTunes DB do not import correctly 
related to 0020312 assignedLudek MMW 5 'Media properties' does not allow to change 'Mapped drive' to 'UNC Path' (and vice versa) 

Activities

peke

2009-04-26 17:56

developer   ~0017596

This would be more than useful for MM4

peke

2009-10-01 22:03

developer   ~0019021

Reminder sent to: rusty

Ticket AQI-746939 is related to this bug and that is why Arrange/tagging are so slow if files are on local folder.

Win 7 and Vista(not confirmed) do not translate local UNC path to local folder but handle them as Network paths.

This raises another question/issue when handling Local Shared folders and UNC Paths: I'll investigate further so that I can see if there is way to warn user when he scans Local path that he/she scans folder that is shared and ask if he wants to scan that folder as shared folder instead local folder.

peke

2009-10-07 02:07

developer   ~0019092

Testing MM Filemonitor aginst local shares on XP SP3 it looks that Windows itself report updates in local file path instead of UNC path which then let MM not see changes.

To Compensate that MM should retrieve Local Shares from Registry "HKLM\System\CurrentcontrolSet\Services\Lanmanserver\Shares" and in case of Local Share UNC monitoring watch for changes in corresponding Local Path.

rusty

2009-10-07 22:15

administrator   ~0019095

Last edited: 2017-09-19 22:34

Note from Peke re. Ticket AQI-746939:

I suspect that problem for this user is that MM watch Share name "\\Local PC\music" and Windows Report changes to "c:\shared Music" as user locally fill that folder.

My proposal in 0005548 should work in three ways. Translate Mapped Drives to UNC Path, do check for local shared Folders and watch if user want to do something to local folder over UNC path.

I asked user to confirm my suspicions. Unfortunately this is not quick fix and it is highly risky unless it is done correctly and with lots of testings.

Re-assigning to Peke for feedback--it's unclear what problem this bug describing (i.e. the bug currently describes a proposed implementation, and it's unclear what problem(s) the implementation trying to solve).

peke

2009-10-20 06:18

developer   ~0019250

As I suspected user also confirmed that Scanning same path locally is considerably faster than scanning it using UNC path of Local Share.

Investigating further on solution we can do to optimize things.

lowlander

2011-12-03 19:03

developer   ~0029224

And how would changing the shared PC name affect this (ie \\MediaServer to \\FileServer). If this would cause problems that would be unexpected to the user.

peke

2011-12-04 08:17

developer   ~0029238

Same like reformatting HDD Partition when Serial gets Changed.
Select All Files -> File -> Locate Moved/Missing

peke

2013-04-14 23:51

developer   ~0035623

Note: Recently tested and NETBIOS name Automatically inflict change returned from this function especially as NETBIOS change require PC Restart while This function is called apron MMW startup for Local PCs, and for remote ones after NETBIOS name change Map drives do not work anyway and needs to be re mapped.

peke

2018-10-25 15:25

developer   ~0051461

Last edited: 2018-10-25 18:10

Local Shares can be easily read from Registry "HKLM\System\CurrentcontrolSet\Services\Lanmanserver\Shares" description on how to decode/tweak and use to translate paths to MMS https://helgeklein.com/blog/2010/07/where-are-share-permissions-stored-hint-registry/ and https://hatsoffsecurity.com/2014/11/09/research-decoding-lanmanservershares/comment-page-1/ and https://www.itprotoday.com/powershell/managing-file-shares-windows-powershell eg. Read all shares and do a simple replace while migrating to MMS 0015183

Also this can be easily expanded to make MMW create/edit shares accessible by MMS when local drive shares contain media and can be accessed over network https://docs.microsoft.com/en-us/previous-versions/windows/desktop/smb/msft-smbshare

jiri

2018-10-31 07:48

administrator   ~0051508

I don't think that we can force anything -- if user scans the collection from a source, it should be linked from MM5 to the source. Note that also UNC path can change (renamed a network resource).

peke

2018-10-31 23:02

developer   ~0051518

Reopen to add few example usages to be more clear as talked with Jiri and how it will work along with changes made in 0015183

peke

2020-10-12 20:14

developer   ~0059833

While revising 0016870 this is still actual issue and will be more important in using on multi platforms and interconnection of LAN/WLAN/CLOUD resources.

left as is for now for future revisions as needed.