1 00:00:00,290 --> 00:00:02,360 Now that we've seen a preview of the 2 00:00:02,360 --> 00:00:04,040 project that we will build for this 3 00:00:04,040 --> 00:00:06,529 course, let's get started by laying out 4 00:00:06,529 --> 00:00:09,410 the skeleton of the project. The first 5 00:00:09,410 --> 00:00:11,120 thing that you need to do for any new 6 00:00:11,120 --> 00:00:13,430 project is to select a name, this project 7 00:00:13,430 --> 00:00:16,039 is patterned after the popular PV 8 00:00:16,039 --> 00:00:18,860 utility, which stands for pipe viewer. So 9 00:00:18,860 --> 00:00:20,690 I'm going to use the project name pipe 10 00:00:20,690 --> 00:00:22,820 viewer, you may use a different project 11 00:00:22,820 --> 00:00:25,100 name if you wish. All that you need to do 12 00:00:25,100 --> 00:00:27,230 is to substitute the name of your choice 13 00:00:27,230 --> 00:00:31,130 wherever I use pipe viewer. Next, we need 14 00:00:31,130 --> 00:00:33,049 to choose a location for our project on 15 00:00:33,049 --> 00:00:35,780 disk. I like to keep my projects in a 16 00:00:35,780 --> 00:00:38,359 dedicated folder, so I will create pipe 17 00:00:38,359 --> 00:00:41,030 viewer in my projects directory. The 18 00:00:41,030 --> 00:00:43,190 location doesn't really matter just as 19 00:00:43,190 --> 00:00:45,019 long as you remember where you put it. 20 00:00:45,019 --> 00:00:47,149 First, I need to get into my projects 21 00:00:47,149 --> 00:00:49,230 directory, 22 00:00:49,230 --> 00:00:53,059 now we can create the project. 23 00:00:53,059 --> 00:00:55,670 Our project is a binary project which is 24 00:00:55,670 --> 00:00:58,039 the default project type, so we don't 25 00:00:58,039 --> 00:01:00,590 have to add any options now let's get 26 00:01:00,590 --> 00:01:03,230 into the directory, 27 00:01:03,230 --> 00:01:07,078 and double-check our Cargo settings. 28 00:01:07,078 --> 00:01:10,030 Cargo.toml is in the top level of the 29 00:01:10,030 --> 00:01:13,000 project. In our package section, we can 30 00:01:13,000 --> 00:01:15,220 see that our name is pipe viewer our 31 00:01:15,220 --> 00:01:19,630 version is 0.10, I am the author, has my 32 00:01:19,630 --> 00:01:21,880 name in my email address, and the 33 00:01:21,880 --> 00:01:25,119 addition is 2018. Our project settings 34 00:01:25,119 --> 00:01:29,080 look good. In a real project, we would 35 00:01:29,080 --> 00:01:31,329 probably use version control software, 36 00:01:31,329 --> 00:01:34,810 such as Git or subversion. Let me show 37 00:01:34,810 --> 00:01:36,610 you a few things that you should 38 00:01:36,610 --> 00:01:39,039 configure your version control software 39 00:01:39,039 --> 00:01:42,670 to ignore in real projects. I will go 40 00:01:42,670 --> 00:01:45,009 ahead and initialize this as a Git 41 00:01:45,009 --> 00:01:47,600 repository, 42 00:01:47,600 --> 00:01:50,630 and then I will create a dot Git ignore 43 00:01:50,630 --> 00:01:53,030 file to tell Git which files it should 44 00:01:53,030 --> 00:01:59,630 never try to track. 45 00:01:59,630 --> 00:02:02,960 The target subdirectory contains all of 46 00:02:02,960 --> 00:02:05,720 your builds files and binaries, things 47 00:02:05,720 --> 00:02:07,580 that aren't source code that you will 48 00:02:07,580 --> 00:02:10,330 generate. 49 00:02:10,330 --> 00:02:13,479 In any directory, which is what the first 50 00:02:13,479 --> 00:02:16,390 two asterisks means, there could be a 51 00:02:16,390 --> 00:02:21,160 file or some files ending in dot RS BK. 52 00:02:21,160 --> 00:02:24,970 Those are backup files that Cargo format 53 00:02:24,970 --> 00:02:26,950 uses when you are Auto formatting your 54 00:02:26,950 --> 00:02:29,080 code and might get left behind, 55 00:02:29,080 --> 00:02:31,300 those are good to ignore, and not 56 00:02:31,300 --> 00:02:33,880 accidentally add to your version control. 57 00:02:33,880 --> 00:02:36,970 Now if we were making a library I would 58 00:02:36,970 --> 00:02:40,840 also add Cargo dot lock, but we are not 59 00:02:40,840 --> 00:02:43,030 making a library so I will comment that 60 00:02:43,030 --> 00:02:46,030 back out. In the next section, we will 61 00:02:46,030 --> 00:02:51,030 have a look at operating with I/O.