Jump to content
Sign in to follow this  

Cannot write #0 to a file

Recommended Posts


OK, I found a way to read a #0 from a file:

Func FileReadByte($hFile)
    Local $ch = FileRead($hFile, 1)
    If @Error Then
        Return -1
    Return Asc($ch)

Basically, if the FileRead() function returns '' and @error is not set, you can assume that the byte is a #0. However, I can't seem to write a #0, because FileWrite() only writes strings (if you pass it a number, it converts it to a string before writing it).

Is there anyway to write a #0 to a file?

I'm writing a set of functions for base64 encoding/decoding, which should solve the problem with binary files and binary data transmission, but I can't write the file back out at the end, because any #0 are left out of the final file.

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.