
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 26504 Articles for Server Side Programming

8K+ Views
In golang we have different inbuild function like Stat(), Open() and mkdir() to check whether a directory exist or not . Here we are using three functions. in the first one we are using the Stat() function present in the os package while in the second and third example we are using Open() and mkdir() function respectively to implement the result. Method 1: Using os.stat() Method The os package provides the Stat() function to get information about a file or directory. If the directory exists, the function returns a FileInfo structure, otherwise, it returns an error. Syntax func ... Read More

5K+ Views
Golang provides several methods to remove a specified directory, including using the os and filepath packages. Removing a directory is a critical operation, and caution should be exercised when performing this task. This article will discuss the different methods to remove a directory in Golang, along with the syntax and algorithm for each method. Method 1: Using The os Package The os package in Golang provides several functions to perform operating system-related operations, including removing a directory. The Remove function of the os package is used to remove a directory. Syntax Remove(dirName) The Remove() function is present in os ... Read More

5K+ Views
In Golang, we have two internal functions - ReadDir() and Walk function to get a list of filenames prenent in a specific directory. Here we have write three examples. In the first example We will use the ReadDir() function present in ioutil package while in the second one we are using the walk function present in the filepath package. Method 1: Using ioutil PACKAGE The ioutil package in Golang provides several functions to perform input/Output operations, including reading the files and directories. The ReadDir() function of the ioutil package is used to get the list of files in a specified ... Read More

1K+ Views
Introduction A queue is a linear data structure that follows the FIFO principle for inserting and removing elements and has no close ending. It is functional on both ends. In this tutorial, we will learn how to turn a queue into a priority Queue and understand the meaning of queue and priority queue in the data structure. What is Queue? Queue in data structure resembles the queue in real life and is used to handle multiple data. It is an ordered list in which elements are entered on the rear end and removed from the front end. In this, the ... Read More

2K+ Views
The Go programming language provides various methods to obtain the home directory of the current user. This information can be useful in many applications, such as file management, system configuration, etc. In this article, we will discuss different methods to get the home directory in Go along with syntax and examples. Method 1: Using os.UserHomeDir() The os.UserHomeDir() function is part of the Go standard library and is the simplest and most efficient method to get the home directory of the current user. Here is an example that demonstrates the usage of os.UserHomeDir() Syntax func UserHomeDir() (string, error) The UserHomeDir() ... Read More

2K+ Views
Introduction Both Queue and Stack are linear data structures and are used to store data. Stack uses the LIFO principle to insert and delete its elements. A Queue uses the FIFO principle. In this tutorial, we will learn how to reverse a stack using Queue. Reversing means the last element of the Stack comes to first place and so on. What is Stack? The stack in the data structure is inspired by the stack in real life. It uses LIFO (Last In First Out) logic, which means the element that enters last in the Stack will be removed first. In ... Read More

4K+ Views
One of the features of Go is the ability to search and retrieve files based on a specified pattern. In this article, we will discuss different methods to get the list of filenames that match a specified wildcard pattern in Go, and provide syntax and examples for each method. Method 1: Using the "filepath.glob" The "filepath.Glob" method is the easiest and most straightforward way to retrieve the list of filenames that match a specified wildcard pattern. The function takes a pattern as input and returns a slice of strings that match the pattern. Syntax filenames, err := filepath.Glob(pattern) The ... Read More

355 Views
Introduction Circular Queue is an improvement over a linear queue and it was introduced to address the memory wastage problem in the linear queue. A circular queue uses the FIFO principle for the insertion and removal of the elements from it. In this tutorial, we will discuss the operations of the circular queue and how to manage it. What is Circular Queue? A circular queue is another kind of queue in a data structure, whose front and rear ends are connected with each other. It is also known as Circular Buffer. Its operations are similar to the linear queue, so ... Read More

4K+ Views
In Go, a directory is a special type of file that holds other files and directories. A directory is used to organize files on a file system and provides a structure to the file system. Go provides several functions in the os package to work with directories, including: os.mkdir, os.remove, os.open, etc. Syntax func Stat(name string) (fi FileInfo, err error) The Stat() function is present in os package and is used to check the status of a particular directory. The function takes a string parameter name, which represents the path of the directory. It returns a FileInfo structure, fi, ... Read More

2K+ Views
In the Go programming language, a file is a named resource for storing data that can be read from or written to. It provides a way for the program to persist data, even after the program has finished executing. Here in this article we will discuss different methods using which we can count the number of lines in a file. Method 1: Using a user-defined function In this method, we will write a go language program to count the number of lines present in the file by using bufio, fmt and os packages. Algorithm Step 1 − First, ... Read More