MakeFile
MakeFile Filename$, Size
 
Parameters:

    Filename$ = The Filename of the file you wish to create
    Size = The size in byte of the file
Returns: NONE
 

      MakeFile will create a blank file. The file will contain only zeroed bytes.

      This only really useful when you need random file access.



FACTS:


      * Before you use MakeFile, always check if the filename (of the file your about to create) already exists previously. If you try and overwrite a file that already exists, PB will return a run time error.



Mini Tutorial:


      This example will create a blank file on the C: Drive called "TestFile.txt" , it then displays the info about this file and then removes itself.


  
  
; Create a variable of the files Filenames
  Filename$="C:\TestFile.txt"
  
; Make the blank file, 100 bytes in size
  MakeFile Filename$,100
  
; display the info about the created file
  Print "File Name:"+Filename$
  Print "File Exist:"+Str$(FileExist(Filename$))
  Print "File Size:"+Str$(FileSize(Filename$))
  
; now delete this file, as it's no use to use anymore
  DeleteFile Filename$
  
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  


This example would output.

  
  File Name:C:\TestFile.txt
  File Exist:1
  File Size:100
  

 
Related Info: :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com