Modify

Opened 15 years ago

Closed 14 years ago

#1982 closed Bug (Fixed)

FileGetShortName crashes when path is too long

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

Description

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 by Pinault <pszczepa@…>, 15 years ago

Illustration by code and unit test available at
http://www.autoitscript.com/forum/topic/131108-filegetshortnamev2au3/
Regards

comment:2 by trancexx, 14 years ago

Milestone: 3.3.7.21
Owner: set to trancexx
Resolution: Fixed
Status: newclosed

Fixed by revision [6350] in version: 3.3.7.21

Modify Ticket

Action
as closed The owner will remain trancexx.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.