Reading the Binary file using FileSystem Object 
Author Message
 Reading the Binary file using FileSystem Object

Hi
I am trying to read binary file using FileSystem Object but it fails when it
tries to read character x00 or xFF
Following is code:
if (fso.Fileexists(strappath&"base.dat")) then
 Set f = fso.Getfile(strappath&"base.dat")
 Set rf = f.OpenAsTextStream(1)
 stra= rf.readall
 rf.close
end if
Is there a way to read the Binary files using VBScript??


Tue, 08 Jun 2004 23:06:30 GMT  
 Reading the Binary file using FileSystem Object
use ADO Stream object
http://msdn.microsoft.com/library/en-us/ado270/htm/mdobjstream.asp

-Deepa


Quote:
> Hi
> I am trying to read binary file using FileSystem Object but it fails when
it
> tries to read character x00 or xFF
> Following is code:
> if (fso.Fileexists(strappath&"base.dat")) then
>  Set f = fso.Getfile(strappath&"base.dat")
>  Set rf = f.OpenAsTextStream(1)
>  stra= rf.readall
>  rf.close
> end if
> Is there a way to read the Binary files using VBscript??



Tue, 08 Jun 2004 00:46:51 GMT  
 Reading the Binary file using FileSystem Object
You can't do it normally. If you want a component that can do it:
http://www.jsware.net/jsware/scripts.html      (see bottom of page.)

--
--

Quote:
> Hi
> I am trying to read binary file using FileSystem Object but it fails when
it
> tries to read character x00 or xFF
> Following is code:
> if (fso.Fileexists(strappath&"base.dat")) then
>  Set f = fso.Getfile(strappath&"base.dat")
>  Set rf = f.OpenAsTextStream(1)
>  stra= rf.readall
>  rf.close
> end if
> Is there a way to read the Binary files using VBscript??



Tue, 08 Jun 2004 01:29:20 GMT  
 Reading the Binary file using FileSystem Object
You can do it reading one by one each character until the end of the file.
You can find a sample using this technique there :
http://www.serialscripter.com/scripts/dumphexafile.html

Regards,
Jean-Luc Antoine



Quote:
> Hi
> I am trying to read binary file using FileSystem Object but it fails when
it
> tries to read character x00 or xFF
> Following is code:
> if (fso.Fileexists(strappath&"base.dat")) then
>  Set f = fso.Getfile(strappath&"base.dat")
>  Set rf = f.OpenAsTextStream(1)
>  stra= rf.readall
>  rf.close
> end if
> Is there a way to read the Binary files using VBscript??



Tue, 08 Jun 2004 04:07:07 GMT  
 Reading the Binary file using FileSystem Object
FileSystemObject does not support binary file access, so you can still use
the original File I/O model in Visual Basic for binary file access. For
example, reference the article HOWTO: Read and Display Binary Data in ASP
(Q193998) at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q193998 for sample
code.

Hope it helps.

Regards,
Robin

This posting is provided AS IS, with no warranties, and confers no rights.



Fri, 11 Jun 2004 16:13:29 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Read write binary file using ADODB.Stream

2. Reading binary file using VBScript

3. VB3 Binary FILES READ READ READ

4. FileSystem Object Read Order

5. FileSystem Object Read Order

6. binary files: reading from and to access7 using vb5

7. Slow file reading using binary methods HELP PLEASE!

8. Reading a C++ Binary file using VB

9. Detecting file changes in the filesystem using FindFirstChangeNotification

10. Reading binary registry values using regobj.dll

11. reading binary file and writing into a random access file

12. Reading File Header Info (Binary Files)

 

 
Powered by phpBB® Forum Software