Modify

Opened 16 years ago

Closed 16 years ago

#1429 closed Feature Request (Rejected)

Change return value of FileGetSize() on failure.

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

Description

Please change the return value of FileGetSize() to -1 when failure occurs. This would make more sense as it is also the way that DirGetSize() works.

Consider the following code.

If Not FileGetSize($sFile) Then FileDelete($sFile)

This code will delete a file if its size is 0. Unfortunately, it would also delete the file if FileGetSize() failed for any reason. Changing the failure return value to -1 would avoid this problem since Not(-1) = False.

Attachments (0)

Change History (1)

comment:1 by Valik, 16 years ago

Resolution: Rejected
Status: newclosed

Uh, no. If you need to know if an error occurred then check @error. That's why functions set it.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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