Sign in to follow this  
Followers 0
HypercamJ

Create a file

5 posts in this topic

I've checked everywhere in the help files but can't find out: What is the code used to create a specific file? For example, I want to create an .ini file if the common one doesn't exist

in the code's directory.


Prove, and I will believe...

Share this post


Link to post
Share on other sites



You can use a basic FileWrite(), or an IniWrite(), (with the right parameters of course), and if the file doesn't exist, and the directory being written to does, the file will automagically be created.


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

create an .ini file if the common one doesn't exist in the code's directory

$ini = @ScriptDir & "\data.ini"

If Not FileExists($ini) Then ; If the ini doesn't exist
    IniWrite($ini, "Section", "Key", "Value") ; Writes to the ini
EndIf

Share this post


Link to post
Share on other sites

There is also a _FileCreate UDF in File.au3

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0