Jump to content
Sign in to follow this  
HypercamJ

Create a file

Recommended Posts

HypercamJ

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
Kickassjoe

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
LongBowNZ

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
NELyon

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.