What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help] What is the best way to read binary file ??

[Help] What is the best way to read binary file ??
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: [Help] What is the best way to read binary file ??
I have a helper script written by Volv that works with binary data. I'll post/attach when I get home.

These should help.

JScript code:
function binReadFile(filePath)
{
    var fstream = new ActiveXObject("ADODB.Stream");
    fstream.Type = 1;
    fstream.Open;
    fstream.LoadFromFile(filePath);
    return fstream.Read;
}
 
function binWriteFile(binData, filePath)
{
    var fstream = new ActiveXObject("ADODB.Stream");
    fstream.Type = 1;
    fstream.Open;
    fstream.Write(binData);
    fstream.SaveToFile(filePath, 2);
    fstream.Close;
}
 
function asciiReadFile(filePath)
{
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var contents = fso.OpenTextFile(filePath, 1, 0).ReadAll();
    return contents;
}
 
function asciiWriteFile(strData, filePath)
{
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var txtfile = fso.CreateTextFile(filePath, true);
    txtfile.Write(strData);
    txtfile.close();
}
 
function GetFileSize(filePath)
{
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    if(fso.FileExists(filePath)) {
        var file = fso.getFile(filePath);
        return file.size;
    } else {
        return -1;
    }
}



This post was edited on 04-19-2009 at 03:32 AM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-19-2009 01:41 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Help] What is the best way to read binary file ?? - by N0na on 04-18-2009 at 09:14 AM
RE: [Help] What is the best way to read binary file ?? - by matty on 04-18-2009 at 01:06 PM
RE: [Help] What is the best way to read binary file ?? - by N0na on 04-18-2009 at 02:00 PM
RE: [Help] What is the best way to read binary file ?? - by MeEtc on 04-19-2009 at 01:41 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On