To provide an improved information processing apparatus and a method for
controlling the same, which enables to smoothly transfer data, such as
processed results obtained from execution of an application program, an
HTML file acquired from a Web server in accordance with the TCP/IP
protocol or the like, to an external device (PDA) by using an infrared
communication function. The disclosed information processing apparatus
periodically accesses a predetermined server machine (e.g., a Web server)
to acquire a desired file (e.g., an HTML file). This file acquisition
operation is carried out without the involvement of operations of an
infrared transceiver. In other words, the information processing apparatus
attempts to continually perform caching of the most recent download data.
As a result, when the PDA as an external device is set into an infrared
communication mode and a user simply holds the PDA to a station
discoverable region of the information processing apparatus, a connection
between them is established, thereby enabling the PDA to receive the most
recent data.