Long Path Library API

Create your own Long Path error 1320 fixing software using our Long Path API library! Ready to run templates and functions plus C#, C++, VB 6.0 usage samples inside.

The purpose of the Long Path API library

Long Path library allows accessing and performing typical operations with a file that has:

  1. very long path (more than 256 characters) – filename too long or path too long error 1320;
  2. unsupported characters in its name (e.g. trailing spaces);

Both NTFS and FAT volumes are supported.

Languages supported

The Long Path library is implemented as a DLL. It can be used with different environments and languages. The ones that were tried are:

  • .NET Languages (C#, VB, Managed C++, etc.);
  • C++ (MS Visual studio family, Borland C++ Builder, etc.);
  • VB 6.0;
  • and others.

Implemented methods

There are a number of low level functions you can use to substitute the common Win32 API:

  • CreateDirectoryL
  • RemoveDirectoryL
  • DirectoryExistsL
  • CreateFileL
  • CopyFileL
  • MoveFileL
  • DeleteFileL
  • FindFirstFileL
  • FindNextFileL
  • FindCloseL
  • GetFileAttributesL

There are also classes like LongFileAndDirectoryManager (.NET), implementing some high level functionality using underlying low level functions.

Path Too Long Samples

There are several samples that demonstrate the library usage:

  • C# sample, which demonstrates the file browser
  • C# sample, which removes trailing spaces from a specified folder recursively
  • C++ sample of library usage
  • VB 6.0 sample of library usage

How to use

It is very easy to include it in your project. To use it with your project, you should perform the following steps:

  • .NET Copy FileDirectoryManager.cs file to your project folder and include it into your solution.
  • C++ include Import.h file to the solution.
  • VB 6 Copy and include module LongPathModule.bas

Copy LongPathLibraryDLL.dll to your project folder and to Debug and Release folders.
For more information, please check the samples folder.

How to redistribute

Copy LongPathLibraryDLL.dll to your application folder and that’s it.

Limitations of trial version

Some functions in trial version are not available; all these functions are setting error code 0×5 (ERROR_ACCESS_DENIED) with SetLastError function. You can check the results using the following code.

In .NET Marshal.GetLastWin32Error() == 0×5.
In C++ GetLastError() == ERROR_ACCESS_DENIED.

Following functions are limited:

  • RemoveDirectoryL
  • CreateFileL (limits opening existing files that are longer than 100 kb)
  • MoveFileL
  • DeleteFileL

Order Long Path API library

If you have any questions regarding the product, purchasing, licenses etc, please feel free to contact us at support@pathtoolong.com

Follow us:

Facebook Facebook Facebook


After having tried numerous programs to delete a number of folders from one of my drives nothing worked. Even using the Command Line with every command and extension I could think off failed. Then I tried your program - Path Too Long Utility™. It worked simply and effectively. To your team of technicians a heartfelt thankyou.

Thanks! Your application worked well and accomplished it's purpose.

I've got the application and it's removed the problem folder. Thanks again.

Thank you. This will help me solve some issues by students.

Julia G.
I finally used your tool and it fixed my problem. I was using a script here, but your program is much better.Thanks and good luck.

Thank you so much for developing the path too long utility. It was the only software that eliminated the files clogging my hard drive, and it freed up 345 GB of space! Thanks again, and keep up the great work!

Les Bohony
Thanks. I had some kind of a virus that wouldn't let me load any security programs. But I had located the application and your program enabled me to delete it. Thanks a million!

Victoria S.
Excellent. That worked. Took it over an hour but it successfully deleted a nested application data series which nothing else would touch and which had swallowed up 79GB of my HDD. Paid for itself in one go.

Mike J.
Ha! I was able to delete several troublesome WORD files. Thanks!

Wayne B.
I needed the 'Pro Version' badly. It is a fantastic program for my needs, in the beginning I had couple of error messages, but I worked around (such as I was copying over files gave me chkdisk error msg, then second time it copied only 250 files instead of 300 files completely-for example!??! I deleted copied folder and re-tried then it worked! etc. etc...)

Nisar M.
I am happy with your product, I have discovered not so long ago, I find it so convenient to help solve the problems of file too long to make a backup copy from HDD because blocking 255 character windows. This is a really useful tool that works very well.

Francois L.
I used the product for the first time to delete a file that I no longer needed. Files was copied from a users “Shared Directory” to a preservation server. A few of the files I needed to delete, when I attempted to delete one (1) of the files would not delete because it was too long. I found your tool on the internet, down-loaded the application and successfully deleted the file.
I was very happy J.
  fx:     'scrollVert',
  prev:   '#prev',
  next:   '#next',
  timeout: 10000,
  delay:  -2000