rred at a time using the control connection. User interface, client control, and client data transfer process are the three compo- nents of the client. Server control process and server data transfer process are the two components of the server (see Figure 30.1). The data connection is established between the client data transfer process and the server data transfer process. If many files are being transferred, the data connec- tion can be opened and closed many times. The control connection is established between the client control process and the server control process. The control con- nection is opened and maintained for the entire interactive FTP session such that for each file transfer, the command for file transfer opens the connection and the connection is terminated after the file transfer. The presence of a separate channel for data transfer and control helps to achieve maximum throughput in data transfer and minimum delay in communication of control signals. This interactive connec- tion between the user and the server remains open for the entire process. File handling is a frequent activity in most operation support solutions. The most common example, where file transfer protocols like FTP and SFTP (secure transfer) is used, is for the management server to collect performance records from the network elements. The network elements generate performance reports at pre- defined intervals. These records are to be transferred as files to the management server, where the files are parsed to analyze the performance of the network ele- ments. In this chapter, the basics of working with file transfer protocol are discussed along with implementation examples on working with files and file transfer. 30.2 Communication with FTP The client and server between which files needs to be transferred may have different operating systems, file structures, file formats, and different character sets. Both File Handling these systems must communicate with each other to facilitate file transfer. FTP is the protocol that enabl