Modify

Opened 22 months ago

Last modified 22 months ago

#3882 assigned Feature Request

IsFileHandle(<AutoIt filehandle as returned by FileOpen)

Reported by: RTFC Owned by: Jpm
Milestone: Component: AutoIt
Version: Severity: None
Keywords: filehandle Cc:

Description (last modified by mLipok)

I would like to write UDFs that (just like FileOpen) accept as input either valid filename OR (AutoIt) filehandle (actually an integer), but there is no way for me to check whether any integer parsed as a filehandle is referring to a currently valid file previously opened with FileOpen. For the moment I'm using this hack:

Func _IsValidFileHandle($fh)
        FileGetPos($fh)         ; non-invasive interaction
        Return (@error=0)       ; an invalid (integer) AutoIt file handle triggers an error
EndFunc

But since various file functions already error out when an invalid AutoIt filehandle is parsed, it must be trivial to implement an IsFileHandle() function to perform this check internally.

Attachments (0)

Change History (3)

comment:1 Changed 22 months ago by TicketCleanup

  • Version 3.3.14.0 deleted

Automatic ticket cleanup.

comment:2 Changed 22 months ago by mLipok

  • Description modified (diff)

comment:3 Changed 22 months ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

Fix sent to Jon

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 assigned The owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.