Jump to content

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.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...