How to find whether a file is transferred thro bin or ascii mode?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find whether a file is transferred thro bin or ascii mode?
# 1  
Old 12-18-2008
How to find whether a file is transferred thro bin or ascii mode?

Hi Gurus,

I need to find out, if i have transferred a file from ftp thro bin mode or ascii mode. Say if i have a file called "dec.sh"( u shuld normally transfer thro ascii mode). How can i find out that dec.sh is tranferred from ftp server thro ascii mode or bin mode?

Any help would be appreciated.

Thanks.
Ashok_oct22
# 2  
Old 12-20-2008
Am giving it a try.

That should be possible with newline feeds. Transferring file in binary mode will not change the linefeeds whereas in ascii feed it will be modified.

I might be wrong Smilie
# 3  
Old 12-21-2008
On opening the file from ftp server if you could find extra characters (square shaped) appended all over the file . U can assume that the transfer mode is ASCII.. and if not then Binary ..
Binary is the preferred mode of file transfer
# 4  
Old 12-22-2008
Hi All,

My question is that how to find whether a file has been transferred from ftp server to unix box thro ascii mode or binary mode? I know there is some no logic behind line feeds.

Sorry as i was not clear in my earlier questionSmilie.
Ashok_oct22
# 5  
Old 12-22-2008
Hi Ultimatix,

I checked the the file the way you said and it worked right. I now need to know the file transferred from ftp to unix has been transferred thro bin or ascii mode?
Ashok_oct22
# 6  
Old 12-22-2008
Quote:
Originally Posted by Ashok_oct22
Hi Ultimatix,

I checked the the file the way you said and it worked right. I now need to know the file transferred from ftp to unix has been transferred thro bin or ascii mode?
Isn't that the same question what you have asked earlier ? Smilie
# 7  
Old 12-22-2008
Hi,

The solution ultimatix gave is for the file transferred from linux box to ftp server. I opened the file after transferring thro both bin and ascii and i culd find the difference(square shape at the end of the file). But how can i know if the file is transferred "From ftp to linux box thro bin or ascii mode"?

Sorry if am not clear in my previous postsSmilie
Ashok_oct22
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

From a C++ application how to find if a hpux host is in standard mode or trusted mode

is there a way for my C++ application to find out which mode the hpux OS is running in? standard mode or trusted mode. (3 Replies)
Discussion started by: einsteinBrain
3 Replies

2. Shell Programming and Scripting

WARNING! 16126 bare linefeeds received in ASCII mode

I am doing FTP from a server and getting below ERROR:WARNING! 16126 bare linefeeds received in ASCII mode File may not have transferred correctly. I looked into web and found that I may need to change the mode to binary, but when I do so the records are not in readable format...So need the file... (10 Replies)
Discussion started by: joshilalit2004
10 Replies

3. Solaris

/bin/find: stat() error <File> : No such file or directory

Hi, I am getting below error in Solaris 10 SPARC when trying to issue a search on /var/tmp partition Below is the query /bin/find /var/tmp/ -type f -atime +1 Below is the result /bin/find: stat() error <File> : No such file or directory (28 Replies)
Discussion started by: prash358
28 Replies

4. Shell Programming and Scripting

Ascii Mode appending extra records to csv file

I am relatively new to this forum and Unix scripting. ksh script: part 1 :will call a PL\SQL program will create 3 CSV file at the unix directory. part 2 : will sftp the files to the EFT server. Once the EFT server receives these file , it will transfer them to a shared windows folders. ... (3 Replies)
Discussion started by: developerpa
3 Replies

5. Shell Programming and Scripting

#!/bin/bash cannot find file or directory

Hello, When i run a bash script on ubuntu i get this message.. #!/bin/bash cannot find file or directory... Can anibody help me with this, because the file actually exists.... Is there any extra configuration to be made? (5 Replies)
Discussion started by: oliveiraum
5 Replies

6. Shell Programming and Scripting

`find`, pulling 1st field from ASCII flat file as search/-name?

Hey Everyone! I have searched around for this on Unix.com and Google, and I'm either not phrasing my search properly or this is not as simple as I thought... I have a script that runs on a nightly basis that pulls one field worth of data from an internal MySQL database and populates to an... (2 Replies)
Discussion started by: Gecko12332
2 Replies

7. Shell Programming and Scripting

SFTP in ASCII mode

Hi Copying a file from Unix (Solaris) to a windows server using sftp. File arrives with carriage returns and line feeds screwed (binary file transfer). Is there a way to get these to copy properly without having to edit or messa about with the file on the windows side. I know with FTP you can... (4 Replies)
Discussion started by: billy_mega
4 Replies

8. UNIX for Advanced & Expert Users

Converting ASCII to Binary mode

Dear All, Business Users are transfering ( FTP ) a CSV file into the IBM AIX box with transfer mode as ASCII. But I want to convert the CSV file from ASCII mode into binary mode, as my script expects file in binary mode. Is it possible to do through Unix commands? Thanks in Advance, RK (1 Reply)
Discussion started by: srajeshmca
1 Replies

9. SCO

compressed file was ftpied in ascii mode needs recovery

I am unbale to uncompress a file which was compress then moved to another pc in ascii mode instead of binary mode. Is there any way to recover it. Please help us. While uncompress it is giving corrupt input. (3 Replies)
Discussion started by: raj2610
3 Replies

10. UNIX for Advanced & Expert Users

Ftp :bin and ascii

Hi , I am trying to ftp a file once using ascii mode and once binary mode The ftp prompt shows different bytes transferred for each of them but at the destination server,each one of these files gets created with the same byte size and are identical.Can anyone shed any light on this ... (1 Reply)
Discussion started by: smehra
1 Replies
Login or Register to Ask a Question