Path,files

When I was watching the visual tutorial, I didn’t quite understand the process of the figure below. Is there a blog about file and path since I am a beginner?

1 Like

Hi Lizhuofeng
Computers store information (data) in hierarchical structures.
So consider films 1990-1999 then 2000-2009. For 1990-1999 you might want 10 sub-divsions 1990,1991… So /1990-1999/1993/Filmfromthisyear.mp4 is the description of the location and the film’s name. /1990-1999/1993 is called the path and Filmfromthisyear.mp4 is called the filename.

You can change to a specific path with cd /1990-1999/1993 (Colab %cd /1990-1999/1993 )
and !ls shows the contents.

path = untar_data(URLS.PETS) is Fastai magic which downloads the PETS data to your computer and path has the value where it has been placed.

path.ls() uses the value of in the variable in path and lists all the files. ls() is Fastai magic equal to the list command (ls).

Although hierarchical structures are common other structures called cyclic graphs such as Google drive do exist but you can ignore them presently.

Since you are a beginner I will give you the standard advice which we all ignore. Do not concentrate too much on the detail but try to copy Jeremy’s work.

Always come to the forum with your question because each one of us came with no understand and one million questions.

Welcome to Fastai.

Regards Conwyn

1 Like

Thanks very much