Sponsored Content
Full Discussion: UNIX and filesize
Top Forums UNIX for Dummies Questions & Answers UNIX and filesize Post 302149530 by benefactr on Thursday 6th of December 2007 12:25:49 PM
Old 12-06-2007
If you are going through a list of files and passing them in, then you can use the ! -s options, ex if [ ! -s /mydir/myfile.txt ] to see if the file is zero size. Flagging them unsure, you could echo "DELETE" to the file or just delete them if the user doesn't want them right then. If you want the flag approach then you can go back later to see if the contents of the file says DELETE and if so delete them.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filesize

I know in php if you use the function filesize it will return the size of the file in bytes, but is there an easy way to get the size in MB. Cheers (2 Replies)
Discussion started by: jmg5
2 Replies

2. Shell Programming and Scripting

FileSize ???

How do I identify if there is any content in a file? If there is nothing in a specified file, I'd like to send an email indicating that there is nothing to report. Any help appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. UNIX for Dummies Questions & Answers

Sorting ls by filesize

I saw some stuff in the search results on this - but nothing specific..... I have a significant number of files (c. 300) which are output from a large process that I run. These are compared with a 'baselined' set of files - so I can quickly see if there are differences based on the sizes of the... (2 Replies)
Discussion started by: peter.herlihy
2 Replies

4. Shell Programming and Scripting

How to truncate as filesize?

Hello everybody it's me again. I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence? in the process are an... (1 Reply)
Discussion started by: Lestat
1 Replies

5. HP-UX

Increasing Filesize on HP-UX UNIX

Dear sir My hp-ux OS version is 11i (11.23) , and Oracle DB is 9i (9.2.0.6) the problem that I can't create any file (DB datafile , export Dump file , Rman backup pices.... etc) under the OS biger than 2 GB and the csh % limit check is %limit cputime unlimited filesize ... (4 Replies)
Discussion started by: ae_nassar
4 Replies

6. Shell Programming and Scripting

filesize

I want to know if there is any unix command to view the size of the file? eg. i have a directory letter in this i have file a,b,c,d,e. i just want to know the size of file d and not any other. (3 Replies)
Discussion started by: infyanurag
3 Replies

7. Shell Programming and Scripting

getting filesize

Hello, I have a script that should store file size in a variable $filesize. I don't know what is the best way to do it. I tried ls -lt myfile.txt | sed something >$filesize but I don't know how to use sed to get filesize. I know that the owner of the file is root and then we have some... (6 Replies)
Discussion started by: pppswing
6 Replies

8. Shell Programming and Scripting

Filesize not working

I am having problems with finding the filesize with this in my script: filesize=`ls -l | awk '$5=0'` if ; then ls -l | awk '{print $9 " " $5}' if ; then echo "Would you like to delete this file? (y/n)" if yes do this elif no do this fi fi else... (7 Replies)
Discussion started by: akeenabawa
7 Replies

9. Shell Programming and Scripting

comparing filesize in unixscript

Well i was trying to code some script where it was required to compare the file size.. i am using solaris 5.10 to get the filesize i used: Filesize=`du -k temp/Final | awk '{print $1}' | sed 's/ //g'` now i need to do if filesize not equal to 0 then do something fi i... (2 Replies)
Discussion started by: egunda
2 Replies

10. Shell Programming and Scripting

if condition for filesize

Hi, I want to check file size in unix, based on file size I am going to execute appropriate command. I tried below, but getting the error. System details – Machine hardware: sun4u OS version: 5.9 if ( -s $f1 ) then echo "filename exists and is > 0 bytes" else echo "filename... (7 Replies)
Discussion started by: rahulbahulekar
7 Replies
CURLOPT_INFILESIZE(3)					     curl_easy_setopt options					     CURLOPT_INFILESIZE(3)

NAME
CURLOPT_INFILESIZE - set size of the input file to send off SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INFILESIZE, long filesize); DESCRIPTION
When uploading a file to a remote site, filesize should be used to tell libcurl what the expected size of the input file is. This value must be passed as a long. See also CURLOPT_INFILESIZE_LARGE(3) for sending files larger than 2GB. For uploading using SCP, this option or CURLOPT_INFILESIZE_LARGE(3) is mandatory. To unset this value again, set it to -1. When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns, but telling one value and sending a different amount may lead to errors. DEFAULT
Unset PROTOCOLS
Many EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { long uploadsize = FILE_SIZE; curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/destination.tar.gz"); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); curl_easy_setopt(curl, CURLOPT_INFILESIZE, uploadsize); curl_easy_perform(curl); } AVAILABILITY
SMTP support added in 7.23.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_INFILESIZE_LARGE(3), CURLOPT_UPLOAD(3), libcurl 7.54.0 February 03, 2016 CURLOPT_INFILESIZE(3)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy