Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    Is there any sort of function that auto detects whether the files is ASCII or BINARY.
    Regards Phil,


  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Before grabbing it from the server?

  4. #3
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,733
    Member #
    5580
    Liked
    718 times
    This is difficult because most tests rely on looking at only a tiny part of the
    file and then guessing. It's right "most" of the time, but that means it
    can also be wrong. That means a test script must open and read part of the file
    ahead of time, before it returns the result.

    Others try to assume by looking at the file extension. Again, they are right
    most of the time.

    The latter method is actually the way most people do it.

    ================

    Perl has the "file" command that can do this test.
    The result using the -B switch is "appears to be binary".
    http://www.samspublishing.com/articl...29311&seqNum=4

    So again, it's almost like a guess.

    ================

    I guess you might just want to look at the file extension and
    determine from that. "If it's a .jpg file, it must be binary"?


  5. #4
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    yea I had the thought of creating an array of ASCII types then if it matches any the download in ASCII else Binary.
    Regards Phil,



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com