- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Akhil Sharma has Published 671 Articles
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
7K+ Views
We are going to use the filepath and string functions of golang to get the file name from the absolute path. An absolute directory begins with the root directory and includes all intermediate directories. In the first method, we will use filepath package functions and in the second example, we ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
2K+ Views
Golang has internal packages like os and io packages for creating a new directory. Here, we will create a directory using two examples. In the first example we will use os.Mkdir function and in the second example we will use ioutil.WriteFile function to execute the program. Method 1: Using os.Mkdir ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
1K+ Views
In golang, we can use os and dir packages to delete a given directory. Here we are using two examples to demonstrate to deletion of an empty and non-empty directory using os.open, os.Removeall. Syntax os.Open This function is a part of os package. It is used to open a ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
426 Views
In golang we can use internal function of OS package to rename a file in various ways. In this article we are going to demonstrate how to change a file name using os. create, os.rename and os.open functions. Method1: Using os.Rename Function In this example, the file oldname.txt is renamed ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
3K+ Views
Golang has os package that is used for deleting a file. In this os package the filename that we wish to delete is initially specified. The file is then deleted using the os.Remove method from the os package.In this article we are using two example to demonstrate the process of ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
2K+ Views
In Golang, we can use Os Packages and IO packages to copy data from one file to another file. n the first method, we'll use OS packages like os.open, os.create and os.copy function. Whereas in the second method, we will use ioutill.Readfile and ioutil.Writefile to copy the files. Method1: ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
1K+ Views
Rename() is one of the internal function of golang used for renaming a specific file. Here we have used three examples in the first one we are using the Rename() function present in os package while in the second example we are using TempFile() function present in the ioutil ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
496 Views
In golang, we have internal function like stat(), Open(0 and Readfile() that is used for checking whether a specific file exist or not. In the first example we are using the stat() method present in the os package while in the second and third example we are using Open() ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
2K+ Views
In Golang, we can use openfile() and Stat() function to check whehter a file has writable permission or not. Here we have written two examples. in the first one we are using OpenFile() method present in the os package while in the second one we are using the Stat() method ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
5K+ 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 ... Read More