Modify

Opened 10 years ago

Closed 10 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 Changed 10 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

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

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 ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.