Tuesday, May 28, 2013

Report Long Paths

So I am involved in a project to move the contents of a large fileshare from a Windows platform to a EMC NAS appliance called 'Isilon'. As with most NAS appliances, it can advertise an SMB type share based on a SAMBA implementation. In this case one that EMC wrote themselves. One challenge is file paths that are very long.

In Windows the default maximum characters for file path is 260 but this is configurable up to the maximum NTFS can handle which is 32,768. This is not configurable on the Isilon.

So in order to better understand the scale of the problem I needed to create a report on how many files have paths longer than 260 characters. The following PowerShell one-liner is all I needed:

get-childitem -r *|? {$_.GetType().Name -match "File"  } |? {$_.fullname.length -ge 260} |%{$_.fullname} > c:\temp\MyPathReport.txt

Simply run that at the root of your share and go have lunch.

Cheers!

No comments:

Post a Comment