Opened 12 years ago

Closed 12 years ago

#1982 closed Bug (Fixed)

FileGetShortName crashes when path is too long

Reported by: Pinault Owned by: trancexx
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


OK for not supporting long paths in most API (see ticket 1795)... fair enough.

But what about FileGetShortName? Surely, this function should not crash when requesting a short name.

Here, there is a double issue actually:

  • the function crashes if the file doesn't exist... well fair enough.
  • the function crashes even if the file exists.

I wrote FileGetShortNameV2 and been using it for a while to demonstrate what the proper behaviour should be to allow to work with long paths: it is squizzing the path but leaves the filename intact.

eg. 'C:\DOCUME~1\PSZCZE~1\LOCALS~1\Temp\AUTOIT~1\FILEGE~1\CRASHT~1\the_filanemeis_the_original_one.txt'

And, btw, using this, it would be possible to create a FileWriteV2, FileReadV2, etc. functions.

Anyway, I don't think FileGetShortName should be crashing when being fed with a long path...

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Pinault <pszczepa@…>

Illustration by code and unit test available at

comment:2 Changed 12 years ago by trancexx

  • Milestone set to
  • Owner set to trancexx
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [6350] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain trancexx.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.