tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
15
Task/Secure-temporary-file/D/secure-temporary-file.d
Normal file
15
Task/Secure-temporary-file/D/secure-temporary-file.d
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
module tempfile ;
|
||||
import tango.io.TempFile, tango.io.Stdout ;
|
||||
|
||||
void main(char[][] args) {
|
||||
|
||||
// create a temporary file that will be deleted automatically when out of scope
|
||||
auto tempTransient = new TempFile(TempFile.Transient) ;
|
||||
Stdout(tempTransient.path()).newline ;
|
||||
|
||||
// create a temporary file, still persist after the TempFile object has been destroyed
|
||||
auto tempPermanent = new TempFile(TempFile.Permanent) ;
|
||||
Stdout(tempPermanent.path()).newline ;
|
||||
|
||||
// both can only be accessed by the current user (the program?).
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue