Welcome to the Mythicsoft Q&A site for:

- Agent Ransack
- FileLocator Lite
- FileLocator Pro

Please feel free to ask any questions on these products or even answer other community member questions.

Useful Links:

- Contact Us
- Help Manuals
- Mythicsoft Home
0 votes

I would like to find all files with a path length greater than 128 characters. Can I do that in FileLocator Pro?

by (715 points)

1 Answer

0 votes

Yes you can using the following methods.

Folder path length

If you only need to compare the folder based path length (ie not including the file name) then you can simply use a location filter.

For example, to search all folder locations that were greater than 128 characters in the Program Files folder you'd search for this:

Look in: C:\Program Files;+:regex:.{128}

Here's how the location filter +:regex:.{128} breaks down

+         - Marks the filter as an inclusion filter
:regex:   - Specifies that it's a regular expression filter
.{128}    - Regular expression to find a character sequence of at least 128 characters

Complete path length

Searching on the complete path length is a little more complicated and involves Scripting. Here are the steps involved:

1. Create the script file

Save this script to a file called path_length.js

// Script for finding files which have a file path over a certain limit

var nMaxSize = parseInt( SearchParms.FilenameCustomParm );

function isValidFileName( strPath, strFileName )
	return ( strPath.length + strFileName.length ) > nMaxSize;

2. Activate the script

Open the scripting tab and select the script for the File name script. Enter the number of characters you want to search for (in your case 128) in the Custom parm field.

alt text

by (31.4k points)