From the course: Rust Programming: Beginner to Advanced
Unlock this course with a free trial
Join today to access over 26,200 courses taught by industry experts.
Performing common filesystem operations - Rust Tutorial
From the course: Rust Programming: Beginner to Advanced
Performing common filesystem operations
In this video, we are going to dive deeper into more advanced file operations and common file system tasks. By the end of the video, you will have a solid understanding of how to perform these file manipulations and how to interact with file systems. The first example we have is of copying files. Copying files is a very common file system task, whether for creating backups or duplicating data for other purposes. And Rust provides you a convenient function which is the copy method from the fs module. So in this example we are using the copy function to copy the contents of example.txt to example.copy.txt. If the operation is successful, a message is printed to confirm that the file was copied and basically the copy function takes care of all the underlying file handling. So making it very easy to duplicate files. Let's run this and see what happens. So as you can see a file was created, the copy file and we also want the message that file copied successfully. Now moving and renaming…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Introduction to network programming in Rust8m 53s
-
(Locked)
Building TCP clients and servers10m 42s
-
(Locked)
Building UDP clients and servers8m 57s
-
(Locked)
Introduction to file handling in Rust10m 39s
-
(Locked)
Performing common filesystem operations5m 55s
-
(Locked)
Project: Networked file transfer application (key concepts: TCP communication, file reading/writing, error handling)20m 33s
-
(Locked)
-
-