Jump to content

fileExist function?


Recommended Posts

Posted

There is a lot file functions like fileOpen fileCreate fileClose and such,but how can i know if specific file is exist? is there any kind of fileExist? i didnt managed to find any function that will tell me that specific file is existed

help

Posted

This way you can check of the file exists or not.

  
local file_handler = fileOpen("path/to/file.txt") 
if not file_handler then 
    file_handler = fileCreate("path/to/file.txt") 
end 
  

Posted

techniqually it tries to open the file, if it's not there create the file... not rly what he wants but still a good example (said that for someone that doesn't understand what the script does)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...