LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2010, 12:48 AM   #1
vipi2005
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
Check the size of a file using FTP


Hi,

I am using FTP to read a file. Before the transfer I need to check the size of file.

I found the keyword to check the size of file in C. But I want to know how to use it.

ftp command to check the size is --> SIZE

ftpXfer(IPaddr, FtpUser, FtpPass,
"", "SIZE %??", RootDir, FileName,
&ctrlSock, &dataSock);

fileSize read
read(dataSock, ??, ??);


Can you please help me for the usage of this keyword.

Thanks in Advance,
Vipin
 
Old 09-07-2010, 07:14 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Are you writing a program in C? Are you using an FTP client? Please give more input on how you want to use this.
 
Old 09-07-2010, 11:19 PM   #3
vipi2005
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you for your quick response.

Yes Im writing a C program in LINUX platform. And its a ftp client.
Most part of the program is already written and I want to know how to find the size of a file present in FTP server.

Actually in ftplib I found the command "SIZE ". But I dont know how to use that. Here I dont have a simulator so that I cant do some trial and error method

Thanks in Advance,
Vipin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH. How check file size ? rbalaa Programming 4 03-26-2010 07:22 AM
shell script - how to check file size noir911 Programming 3 01-24-2009 09:17 AM
How to write crontab to check file size and all file in a directory? modpriest Linux - Newbie 1 02-14-2008 06:48 AM
perl- check size to see if file is complete michael.barnes Programming 2 02-13-2008 06:20 PM
Need script to check file size. _TK_ Linux - General 1 08-06-2001 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration