Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to tell a binary from a text file?
Message
From
17/01/2001 11:26:20
Donald Krasnick
Stanton Systems and Consulting
Havertown, Pennsylvania, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00464420
Message ID:
00464703
Views:
23
>Is there a way to read a file type? i.e if I expect to receive coma delimited files and get a spreadsheet instead, is there anyway to tell?
>
>Thanks

There really is no concept of a file type at that level - it's just a string of bytes. What you may want to do is use FREAD() to read in the first 'n' bytes and look through them one-by-one. If you find "binary" data (where ASC(x) < 32 or > 126, except for 13 and 10 (carriage return/linefeed)), you probably have a "binary" file.

Don
Previous
Reply
Map
View

Click here to load this message in the networking platform