
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

853 Views
In this golang article, we are going to use os.OpenFile() and ioutil.Readfile() to append the given file without truncating it. In the first Example, we are going to Os.Openfile to access the file and then by using file.WriteString function we will append it. In the second Example, we will use ioutil, ReadFile(), ioutil.WriteFile() and Append() functions to perform the same operation on the file without truncating it respectively. Syntax file.read() The Read() function is used to read the contents of a file. The function accepts the file whose contents are to be read as an argument and returns the ... Read More

2K+ Views
In Golang, read-only mode refers to a mode of operation in which a file, directory, or device can only be viewed or read, but not modified or deleted. This mode is used to prevent accidental changes in the data. In computer systems, the read-only mode can be set at the file or folder level, or it can be set for an entire disk or partition. In this article, we will use three Examples to open a file in read-only mode. In the first Example we will use open function from the os package, in the second Example we will use ... Read More

587 Views
In golang we can os.Openfile function of os package and ioutil.WriteFile() function of ioutil package to append a file. Then, we will use WriteString() function to print the result. In this article, we are going to learn how to create a golang programt to open a file in append mode incase the file does not exist. Syntax os.OpenFile(name/path string, flag int, perm FileMode) The OpenFile() function is present in os package. The function accepts three arguments. One is the name of the file that is to be opened followed by the int type instruction used to open a ... Read More

1K+ Views
In Go programming language, os and io packages can be used for performing various operations on external files like copying, editing, and even appending them. In this article, we will learn two Examples to open a file in append mode. In the first Example we will use os.OpenFile function from os package and in the second Example we will use ioutil.WriteFile function from ioutil package. Syntax os.OpenFile("test.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) The OpenFile() function is present in os package and is used to open a file. The function accepts the file to be opened as argument to the function along with ... Read More

260 Views
In Golang, the functions os.openfile () and ioutil.Writefile() are used to access/open a file in read-write mode without truncating it. In this article, we will understand the functionality of these two functions using two different methods. In the first method we will use the OpenFile() function present in os package and In the second method, we will use the WriteFile() function to implement the result. Syntax os.OpenFile() The OpenFile() function is present in os package and is used to open a file. The function accepts the file to be opened as argument to the function along with ... Read More

3K+ Views
In Golang, we can use OS functions os.OpenFile(), os.Create() and ioutil.WriteFile to open a write-only file. Here we are going to see three different Examples to understand the functionality of these functions. In the first program we will use the OpenFile() function while in the second and third program, we will use the writeFile() and create() function respectively. Syntax func WriteFile(filename string, data []byte, perm os.FileMode) error The WriteFile() function is present in the ioutil package and is used to write the data in the file. The function accepts the name of file in which data is to be ... Read More

5K+ Views
The number system is of four types: Binary, Octal, Decimal and Hexadecimal with base value 2, 8, 10 and 16 respectively. The base value depends on the number of digits contained by number system. For example, hexadecimal number system contains 16 digits i.e. 0 to 9 and A to F. Hence, its base is 16. In this article, we will discuss the binary and decimal number systems. Also, we will make java programs to convert decimal to binary numbers. Binary and Decimal number system Binary number system Binary number system works in the form of 0s and 1s. Since ... Read More

323 Views
An array is a linear data structure that stores a group of elements with similar datatypes, in a sequential order. Once we create an array, we can’t change its size, i.e., it can store a fixed number of elements. In this article, we will learn how to write a Java program where we create an array and perform the right rotation using the reversal algorithm. Right Rotation of an Array Let’s understand the term right rotation in the context of an array. In the right rotation of an array, we simply shift the elements of the array to our right till the specified number ... Read More

9K+ Views
The Java program starts execution when the JVM calls the main() method. A Java application begins with this method. Without a main() method, a Java file will compile successfully because at compile time, the compiler doesn't check for a main method, but at run time JVM checks whether the main() method is available or not. Therefore, we will get an exception at run time. In this article, we will understand why we follow the convention "public static void main(String[] args)." The Syntax of a basic Java program looks like: public class class_name { // This line must be ... Read More

1K+ Views
The given task is to write a Java program to convert it into its equivalent decimal number system. The base value of hexadecimal is 16, and decimal is 10. When we convert the hexadecimal to decimal, the base value 16 will be changed to 10. The number system is of four types: Binary, Octal, Decimal, and Hexadecimal. The base value depends on the number of digits contained by the number system. For example, the binary number system contains only two digits, 0 and 1. Hence, its base is 2. Hexadecimal Number System It represents the numbers from 0 to 9 ... Read More