Samual Sam has Published 2492 Articles

ftp_login() function in PHP

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

66 Views

The ftp_login() function allows you to log in to the FTP connection.Syntaxftp_login(con, user_name, password);Parameterscon − The FTP connectionuser_name − The user name to log inpassword − The password to loginReturnThe ftp_login() function returns TRUE on success or FALSE and warning on failure.ExampleThe following is an example −Read More

Display month by name and number in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

332 Views

Use the ‘b’ conversion character for month name in Java.Use the ‘m’ conversion character for month number in Java.Here, we are using Formatter and Calendar class, therefore import the following packages.import java.util.Calendar; import java.util.Formatter;The following is an example to display month name and number −Example Live Demoimport java.util.Calendar; import java.util.Formatter; public ... Read More

ftp_mkdir() function in PHP

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

57 Views

The ftp_mkdir() function is used to create a new directory on the FTP server.Syntaxftp_mkdir(con, dir);Parameterscon − The FTP connectiondir − The name of the directory to be createdReturnThe ftp_mkdir() function returns name of the directory on success, or FALSE on failureExampleThe following is an example that creates a new directory ... Read More

Get an Absolute Filename Path from a Relative Filename Path in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

179 Views

The method java.io.File.getAbsoluteFile() can be used to acquire the absolute filename path from a relative filename path in Java. This method requires no parameters. It returns the file that is defined by the path name.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo { ... Read More

Display minutes with SimpleDateFormat(“m”) in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

109 Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“m”) to display minutes.Format f = new SimpleDateFormat(‘”m”);Now, get the minutes in a string.String strMinute = f.format(new Date());The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo ... Read More

Get the element ordered first in Java TreeSet

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

100 Views

To get the element ordered first i.e. the first element in TreeSet, use the first() method.Create a TreeSet and add elements to it −TreeSet set = new TreeSet(); set.add("65"); set.add("45"); set.add("19"); set.add("27"); set.add("89"); set.add("57");Now, get the first element −set.first()The following is an example to get the element ordered first in ... Read More

ftp_nb_fget() function in PHP

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

35 Views

The ftp_nb_fget() function downloads a file from the FTP server and saves it into an open file.Syntaxftp_nb_fget(con, open_file, server_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionopen_file − The local data is stored here.server_file − The server file to download.transfer_mode − This is the transfer mode. The following are the possible values:- ... Read More

Determine if two filename paths refer to the same File in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

690 Views

The method java.io.File.equals() is used to find if the two file names refer to the same File in Java. This method requires a single parameter i.e.the file object that is to be compared to the other file object. It returns if the file objects are same and false otherwise.A program ... Read More

Display complete date and time information using Formatter in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

102 Views

Firstly, create a Formatter and Calendar object.Formatter f = new Formatter(); Calendar cal = Calendar.getInstance();Now display the current date and time. We have shown the date here in both lowercase and uppercase −f = new Formatter(); System.out.println(f.format("Date and Time (lowercase): %tc", cal)); f = new Formatter(); System.out.println(f.format("Date and Time (uppercase): ... Read More

ftp_nb_put() function in PHP

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:24

87 Views

The ftp_nb_put() function uploads a file to the FTP server.Syntaxftp_nb_put(con, remote_file, local_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionremote_file − The file to upload tolocal_file − The local file path to uploadtransfer_mode − This is the transfer mode. The following are the possible values:- FTP_ASCII, or- FTP_BINARYbeg_pos − The position to ... Read More

Advertisements