Modify

#1970 closed Bug (Fixed)

Bug added to internal __FTP_ListToArray()

Reported by: Beege Owned by: guinness
Milestone: 3.3.9.0 Component: Standard UDFs
Version: 3.3.7.13 Severity: None
Keywords: Cc:

Description

Very sorry about this but some time back I submitted a request here http://www.autoitscript.com/trac/autoit/ticket/1499 that had a mistake in it. I thought it got caught before being added to the beta but it didnt. The bug is that if the user specifys only files or only dirs to be returned, nothing gets returned due to incorrect rediming at the end. Attached is the function pulled from the beta udf with all changes/fixs surrounded in xxxxxxxxxxxxxxxx's. The example verifys all possible return methods are working correctly this time and demonstrates current broken code. Again Im very sorry about this.

Attachments (2)

_FTP_Listtoarray Fix.au3 (7.4 KB ) - added by Beege on Jul 10, 2011 at 10:20:34 AM.
FTPEx.au3 (72.8 KB ) - added by J-Paul Mesnage on Jan 28, 2012 at 12:18:20 PM.

Download all attachments as: .zip

Change History (9)

comment:1 by anonymous59, on Jul 22, 2011 at 4:39:20 PM

I'd still argue that the smaller version from BT #1499 is a better choice as it results in less code to maintain, is faster, and it's only functional difference is useful.

Returning the results in Folder/File/File.../File/Folder/File/File.../File/Folder... sequence allows you to determine which files are within which folders. That information is lost in the larger version where the array is returned in "Folder/Folder.../Folder/File/File.../File" order.

comment:2 by anonymous, on Aug 9, 2011 at 8:30:58 PM

The Folder/File/File... sequence is also what is returned by both FileOpenDialog() and _FilelReadToArray()

comment:3 by Beege, on Aug 13, 2011 at 8:03:08 PM

Wait your function just returns the files/folders in alphabetical order. Im not following you when you say it helps you determine which files are in which folders. Determining what files are in what folders would require some form of recursion. Also FileOpenDialog() only returns the file paths of the files you selected. When the documentation says "Results for multiple selections are "Directory|file1|file2|...", that first directory you see is the directory your choosing files from and is the only directory returned. All other dirs (the ones you selected) will not be returned.

_FileListtoArray does return an alphabetized list the same as your function. But that kind of a change could still be considered "script breaking" which im always agains unless it opens doors to future code or is significatly faster.

comment:4 by anonymous, on Jan 27, 2012 at 9:54:11 AM

This Bug was not fixed in Release of 3.3.8.0 hope it will be in 3.3.9.0, Quite important!

comment:5 by J-Paul Mesnage, on Jan 27, 2012 at 2:31:12 PM

I am working on it
I attach my proposed solution

Last edited on Jan 28, 2012 at 12:17:41 PM by J-Paul Mesnage (previous) (diff)

by J-Paul Mesnage, on Jan 28, 2012 at 12:18:20 PM

Attachment: FTPEx.au3 added

comment:6 by guinness, on Jan 29, 2012 at 10:16:08 AM

Milestone: 3.3.9.0
Owner: set to guinness
Resolution: Fixed
Status: newclosed

Fixed by revision [6735] in version: 3.3.9.0

comment:7 by J-Paul Mesnage, on Feb 9, 2012 at 2:56:33 PM

Component: AutoItStandard UDFs

Modify Ticket

Action
as closed The owner will remain guinness.

Add Comment


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