December 2021
Intermediate to advanced
510 pages
11h 20m
English
In its current version, the mdp tool creates an HTML file with the same name as the Markdown file in the current directory. This isn’t ideal as these files can accumulate on your system or could cause a clash if two or more users are previewing the same file simultaneously.
To address this issue, let’s make a change to the mdp tool to create and use temporary files instead of local files. The ioutil package provides a function TempFile to create temporary files with a random name. This allows it to run safely concurrently because the file names will never clash.
The ioutil.TempFile function takes two arguments. The first is the directory where you create the file. If left blank, it uses the ...
Read now
Unlock full access