-=TheShadow=-

fileExist function?

Recommended Posts

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

Share this post


Link to post

i tried it,but when i fileOpen false file it retures ERROR and not just false value.

EROR: fileOpen; unable to load file  

Share this post


Link to post

Well, you can ignore this error - it'll still work as you want.

Share this post


Link to post

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 
  

Share this post


Link to post

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)

Share this post


Link to post

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.