torels Posted June 11, 2008 Share Posted June 11, 2008 Hello Does anybody know how to write a null char [Chr(0)] to a file ? I tried using Chr(0) but it desn't write anything... or it does but writes "" instead of (null) Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Kip Posted June 11, 2008 Share Posted June 11, 2008 Because Null = "". 'Null' is nothing, it's End of line. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
JRowe Posted June 11, 2008 Share Posted June 11, 2008 Why would you want to write nothing to a file? Just curious. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
torels Posted June 11, 2008 Author Share Posted June 11, 2008 Because Null = "". 'Null' is nothing, it's End of line.OK... but if I write a script in vbs writing Chr(0) on a file and open it in scite I get the 'nul' rectangle and if I write it in autoit I get simply nothing... why ? Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
torels Posted June 11, 2008 Author Share Posted June 11, 2008 Why would you want to write nothing to a file? Just curious.I want to write the zip header on a file... and it includes 18 'null's not 18 ""s & chr(5) & chr(6) & P & K Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Kip Posted June 11, 2008 Share Posted June 11, 2008 I want to write the zip header on a file... and it includes 18 'null's not 18 ""s & chr(5) & chr(6) & P & KThen just try that. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
torels Posted June 11, 2008 Author Share Posted June 11, 2008 It's What I did... But it doesn't work --> http://www.autoitscript.com/forum/index.ph...mp;#entry534471I'ts only working on VBSI think it's just the way autoit treats nul characters Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
monoceres Posted June 11, 2008 Share Posted June 11, 2008 (edited) You need to open the file in binary mode to write the null char: $handle=FileOpen("hello.au3",17) FileWrite($handle,Chr(0)) Edited June 11, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
torels Posted June 11, 2008 Author Share Posted June 11, 2008 YES! thanks alot monoceres Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
James Posted June 11, 2008 Share Posted June 11, 2008 You need to open the file in binary mode to write the null char: $handle=FileOpen("hello.au3",17) FileWrite($handle,Chr(0)) Then you could probably open the file in normal mode allowing you to write other data, but I doubt it will work or is nessacary. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
picaxe Posted June 11, 2008 Share Posted June 11, 2008 adding text in binary mode works $hFile = FileOpen("test.tmp", 18) FileWrite($hFile, "the quick brown fox " & Chr(0)) Link to comment Share on other sites More sharing options...
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