Sign in to follow this  
Followers 0
Matthy

instn there a function filecreate?

4 posts in this topic

#1 ·  Posted (edited)

Hi,

i am making a program that Writes peaces of code and saves it in a file just a text file

but i was wondering if there was a function like filecreate?

in the help i see

Related FileOpen 
FileClose, FileReadLine, FileWriteLine, FileRead

meaby it is possible with ShellExecute but does anyone knows the paremeters

; Open Notepad
ShellExecute("Notepad.exe")

; Open a .txt file with it's default editor
ShellExecute("myfile.txt", "", @ScriptDir, "edit")oÝ÷ ÚÊ-ê®zËb¢x¬È­¦"nW­¢f¤y«^Æ×âà¡yêì1«m%¨¢Ø¡j÷·w'èºwl¢g­)àjëh×6_filecreate(@scriptdir & "\test.txt")

but do you need to include something it is a udf?

Edited by Matthy

Share this post


Link to post
Share on other sites



Right from the HELP FILE.

Creates or zero's out the length of the file specified.

#include <File.au3>

_FileCreate ( $sFilePath )

Parameters

$sFilePath Path and filename of the file to be created.


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Right from the HELP FILE.

Creates or zero's out the length of the file specified.

#include <File.au3>

_FileCreate ( $sFilePath )

Parameters

$sFilePath Path and filename of the file to be created.

damn your right it was in the udf help file forgot about that one Thx man :)

#include <File.au3>
If Not _FileCreate("error.log") Then
   MsgBox(4096,"Error", " Error Creating/Resetting log.      error:" & @error)
EndIf

Share this post


Link to post
Share on other sites

Also ... Right from the help file under FileOpen command - Remarks:

When opening a file in write mode, the file will be created if it does not exist.

So
FileOpen ("C:\test.txt", 2)

will create that file - this way you can avoid including a whole UDF (File.au3 has around 600+ lines of code) into your script just for such a simple operation.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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