PDF name is too long

@Romario_Almeida

Hello Romario,

a very interesting challenge. As far as I understand this document about paths correct, are the restrictions with version 1607 finished. I tried that with version1909, but without success.

Then I tried it with short and long path names, e.g.
C:\Dummy\DIESIS~1\DIESIS~1\UNDNOC~1\ABCDEF~1\ABCDEF~1\ABCDEF~1\ABCDEF~1\Test\DIESIS~1\Test.txt
instead
C:\Dummy\Dies ist ein Test\Dies ist ein Test für lange lange Verzeichnisnamen\Und noch länger soll es werden mal schauen wie es damit funktioniert\abc def ghi jklmnop qrstuvwxyz\abc def ghi jklmnop qrstuvwxyz\abc def ghi jklmnop qrstuvwxyz\abc def ghi jklmnop qrstuvwxyz\Test\Dies ist wieder ein Test\Test.txt
but also without success. It seems that dotNET the short path names resolves to long path names. You can see here that the name of each folder is shortened to 8 characters, from “Dies ist ein Test” to “DIESIS~1”.

Here now a tiny experimental library to handle path lengths until 32767 characters.

GetPathName.1.0.0.nupkg (5.9 KB)

Only three functions:

image

Get Long Path Name
Converts a path from short to long form.

Get Short Path Name
Converts a path from long to short form.

Copy File
Copies a file from source to destination.
With this method you can copy your file in a folder which length is < 260, to handle it.

All activities bases on Win32 API.

Best regards
Stefan

2 Likes