Karthikeya Boyini has Published 2193 Articles

ftp_get_option() function in PHP

karthikeya Boyini

karthikeya Boyini

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

130 Views

The ftp_get_option() function returns runtime options of the FTP connection.Syntaxftp_get_option(con, option);Parameterscon − The FTP connection.option − The runtime option to return.The following are the possible values −FTP_TIMEOUT_SEC - The timeout used for network operationsFTP_AUTOSEEK - Returns TRUE if this option is on, FALSE otherwiseReturnThe ftp_get_option() function returns the value on ... Read More

Specify a path for a file or a directory in Java

karthikeya Boyini

karthikeya Boyini

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

4K+ Views

The path for a file can be obtained using the method java.io.File.getPath(). This method returns the abstract pathname in the form of a pathname string and it requires no parameters.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void main(String[] ... Read More

Get ClassPath from RuntimeMXBean in Java

karthikeya Boyini

karthikeya Boyini

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

147 Views

RuntimeMXBean in the management interface for the runtime system of the Java virtual machine.RuntimeMXBean runtimeMX = ManagementFactory.getRuntimeMXBean();To get the class path, use the getClassPath() method −runtimeMX.getClassPath()The following is an example −Example Live Demoimport java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.util.Date; public class Demo { public static void main(String args[]) throws ... Read More

ftp_get() function in PHP

karthikeya Boyini

karthikeya Boyini

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

371 Views

The ftp_get() function is used to downloads file from the FTP server and save it into a local file.Syntaxftp_fget(con, local_file, server_file, mode, startpos);Parameterscon − The FTP connectionlocal_file − A file where the data is storedserver_file − The server file to downloadmode − The transfer modestartpos − The position to begin ... Read More

Get system start time from RuntimeMXBean in Java

karthikeya Boyini

karthikeya Boyini

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

349 Views

RuntimeMXBean in the management interface for the runtime system of the Java virtual machine.RuntimeMXBean runtimeMX = ManagementFactory.getRuntimeMXBean();To get the system start time, use the getStartTime() method −new Date(runtimeMX.getStartTime()The following is an example −Example Live Demoimport java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.util.Date; public class Demo { public static void main(String ... Read More

ftp_mdtm() function in PHP

karthikeya Boyini

karthikeya Boyini

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

175 Views

The ftp_mdtm() function returns the last modified time of a specified file in PHP.Syntaxftp_mdtm(con,file);Parameterscon − The FTP connectionmyfile − The file to checkReturnThe ftp_mdtm() function returns the last modified time as a Unix timestamp.ExampleThe following is an example −

Compare two file paths in Java

karthikeya Boyini

karthikeya Boyini

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

998 Views

Two file paths can be compared lexicographically in Java using the method java.io.File.compareTo(). This method requires a single parameter i.e.the abstract path name that is to be compared. It returns 0 if the two file path names are equal.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; ... Read More

Sort items in a Java TreeSet

karthikeya Boyini

karthikeya Boyini

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

808 Views

First, 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, sort it in ascending order, which is the default −Iterator i = set.iterator(); while(i.hasNext()){ System.out.println(i.next()); }If you want to sort in descending order, then use the descendingIterator() ... Read More

Display hour with SimpleDateFormat(“H”) in Java

karthikeya Boyini

karthikeya Boyini

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

462 Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“H”) to display hour in a day.Format f = new SimpleDateFormat("H");Now, get the hour −String strHour = 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 ... Read More

ftp_nb_continue() function in PHP

karthikeya Boyini

karthikeya Boyini

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

62 Views

The ftp_nb_continue() function continues to receive or send a file to the FTP server. That means the download continues.Syntaxftp_nb_continue(con);Parameterscon − The FTP connection.ReturnThe ftp_nb_continue() function returns any of the following values −FTP_FAILED − send/receive failedFTP_FINISHED − send/receive completedFTP_MOREDATA − send/receive in progressExampleThe following is an example. Here., “new.txt” is a ... Read More

Advertisements