Modify

Opened 13 years ago

Closed 13 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 Changed 13 years ago by Pinault <pszczepa@…>

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

comment:2 Changed 13 years ago by trancexx

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

Fixed by revision [6350] in version: 3.3.7.21

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

Action
as closed The owner will remain trancexx.
Author


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

 
Note: See TracTickets for help on using tickets.