User Tools

Site Tools


creating_20temporary_20files_20and_20directories

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

creating_20temporary_20files_20and_20directories [2018/03/31 13:19]
127.0.0.1 external edit
creating_20temporary_20files_20and_20directories [2018/04/17 15:26] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Jon Ripley, August 2007//\\ \\  The **FNtempfile** function creates and returns the name of a unique file in the current temporary directory. You should ensure that you delete this file when you no longer require it.\\ \\  //by Jon Ripley, August 2007//\\ \\  The **FNtempfile** function creates and returns the name of a unique file in the current temporary directory. You should ensure that you delete this file when you no longer require it.\\ \\ 
 +<code bb4w>
         file$ = FNtempfile         file$ = FNtempfile
         REM ...         REM ...
         SYS "​DeleteFile",​ file$         SYS "​DeleteFile",​ file$
 +</​code>​
 \\  The **FNtempdir** function creates and returns the name of a unique directory in the current temporary directory. You should ensure that you delete this directory when you no longer require it.\\ \\  \\  The **FNtempdir** function creates and returns the name of a unique directory in the current temporary directory. You should ensure that you delete this directory when you no longer require it.\\ \\ 
 +<code bb4w>
         dir$ = FNtempdir         dir$ = FNtempdir
         REM ...         REM ...
         SYS "​RemoveDirectory",​ dir$         SYS "​RemoveDirectory",​ dir$
 +</​code>​
 \\  The "​RemoveDirectory"​ call requires that the directory to be deleted is empty. To delete a non-empty directory use the **PROCremovedirectory** function as demonstrated:​\\ \\  \\  The "​RemoveDirectory"​ call requires that the directory to be deleted is empty. To delete a non-empty directory use the **PROCremovedirectory** function as demonstrated:​\\ \\ 
 +<code bb4w>
         dir$ = FNtempdir         dir$ = FNtempdir
         REM ...         REM ...
         PROCremovedirectory(dir$)         PROCremovedirectory(dir$)
 +</​code>​
 \\  The code for the **FNtempfile**,​ **FNtempdir** and **PROCremovedirectory** functions referenced in this article are listed below:\\ \\  \\  The code for the **FNtempfile**,​ **FNtempdir** and **PROCremovedirectory** functions referenced in this article are listed below:\\ \\ 
 +<code bb4w>
         DEF FNtempfile         DEF FNtempfile
         LOCAL T%         LOCAL T%
Line 43: Line 50:
         SYS "​SHFileOperation",​ shfo{}         SYS "​SHFileOperation",​ shfo{}
         ENDPROC         ENDPROC
 +</​code>​
 \\  The string "​tmp"​ passed to "​GetTempFileName"​ is a prefix for the temporary file name which you may change to any three character string, perhaps to be distinctive to your application. \\  The string "​tmp"​ passed to "​GetTempFileName"​ is a prefix for the temporary file name which you may change to any three character string, perhaps to be distinctive to your application.
creating_20temporary_20files_20and_20directories.txt ยท Last modified: 2018/04/17 15:26 by tbest3112