Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

FTP - Distinguishing between ASCII & Binary Automatically

Options
  • 15-04-2005 9:42am
    #1
    Moderators, Business & Finance Moderators Posts: 3,816 Mod ✭✭✭✭


    Is there any FTP clients out there that can automatically distinguish between ASCII & Binary files during upload without the user having to specify which type of upload to do. The problem I'm having is with files that don't have an extension so it's not possible to add these files to either the ASCII or Binary group. I know there are plenty of apps (diffing apps for example) that can tell whether a file is ASCII or Binary so surely there is an FTP client that has this built in functionality?


Comments

  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Many FTP clients do have auto transfer functionality where you do not have to define the file type, but I would suspect that this goes by the extension.

    AFAIK, if you just always use binary, then ascii files should still be ok - can anyone else confirm / deny this?


  • Moderators, Business & Finance Moderators Posts: 3,816 Mod ✭✭✭✭LFCFan


    Yeah, there is auto functionality but only by extension type. I can upload the files (windows to unix) through binary when they are ASCII files but it does cause a problem and a furthur scripts needs to be run on the ASCII files to fix the problem. This situation isn't ideal and it would make it a lot easier if there was an FTP client that could distinguish even if there's no extension!


  • Registered Users Posts: 6,508 ✭✭✭daymobrew


    In shell or perl I use the -T file test operator. My guess is that it opens the file, looks for carriage returns.

    Maybe a ftp client could do this. There are a few on Sourceforge.net and you could submit an enhancement request, maybe even provide a patch that implements the feature.
    Then the configuration could be enhanced to have a 'Check file' option to determine the transfer mode.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,687 Mod ✭✭✭✭Capt'n Midnight


    ASCII stupid question, get a stupid ANSI ...

    Here goes,
    with ftp is an ASCII file just a binary file with byte values of 32-127 and ending in 26 (Ctrl Z) or 0 (nul) or are there other rules ?


  • Registered Users Posts: 6,508 ✭✭✭daymobrew


    My understanding is that ASCII transfer mode changes how line end characters are handled.
    In binary mode nothing is changed.
    In ASCII mode going from a Windows system to a Linux/Unix system \r\n is changed to \n (or \r, I can never remember which), and vice versa.

    The file being transferred can have whatever characters it likes, no 32-127 limit.


  • Advertisement
  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Generally after logging in just pass the command "BINARY" to the FTP server and it should force it to send everything as binary.


Advertisement