Samual Sam has Published 2310 Articles

ftp_mkdir() function in PHP

Samual Sam

Samual Sam

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

109 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

266 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

173 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

152 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

94 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

1K+ 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

140 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

128 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

Remove an element from a Stack in Java

Samual Sam

Samual Sam

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

5K+ Views

An element can be removed from a stack using the java.util.Stack.pop() method. This method requires no parameters and it removes the element at the top of the stack. It returns the element that was removed.A program that demonstrates this is given as follows −Example Live Demoimport java.util.Stack; public class Demo { ... Read More

ftp_nlist() function in PHP

Samual Sam

Samual Sam

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

91 Views

The ftp_nlist() function returns a list of files in the specified directory on the FTP server.Syntaxftp_nlist(con, dir);Parameterscon − The FTP connectiondir − The directory to be listedReturnThe ftp_nlist() function returns an array of file names on success or FALSE on failure.ExampleThe following is an example wherein we are getting the ... Read More

Advertisements