tannerli Posted June 11, 2007 Posted June 11, 2007 Already used Forum Search.... and also the helpfile Am I terribly wrong now or does AutoIt lack a CreateFile() - Function.....? I don't need to read/write it, it just has to exist.... I used FileClose(FileOpen("command.fil", 1)) instead but I think there's an easier way.... greetings tannerli
Gabburd Posted June 11, 2007 Posted June 11, 2007 Try this #include <file.au3> _FileCreate("command.fil")
poisonkiller Posted June 11, 2007 Posted June 11, 2007 No you aren't, _FileCreate() works almost exactly as your method: expandcollapse popup;=============================================================================== ; ; Description: Creates or zero's out the length of the file specified. ; Syntax: _FileCreate( $sFilePath ) ; Parameter(s): $sFilePath - Path and filename of the file to be created ; Requirement(s): None ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets: ; @error = 1: Error opening specified file ; @error = 2: File could not be written to ; Author(s): Brian Keene <brian_keene at yahoo dot com> ; Note(s): None ; ;=============================================================================== Func _FileCreate($sFilePath) ;============================================== ; Local Constant/Variable Declaration Section ;============================================== Local $hOpenFile Local $hWriteFile $hOpenFile = FileOpen($sFilePath, 2) If $hOpenFile = -1 Then SetError(1) Return 0 EndIf $hWriteFile = FileWrite($hOpenFile, "") If $hWriteFile = -1 Then SetError(2) Return 0 EndIf FileClose($hOpenFile) Return 1 EndFunc ;==>_FileCreate It's copied from File.au3.
tannerli Posted June 11, 2007 Author Posted June 11, 2007 Yeah, but I should have found it before.... I really looked in the help file However, thx greetings tannerli
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now