Re: File Size Limit

2016-04-08 Thread Shlomi Fish
Hi James, please reply to all recipients. On Fri, 8 Apr 2016 10:47:57 +0100 James Kerwin wrote: > Good morning/afternoon all (depending on where you are), > > This should be a quick one: > > When creating files in a perl script is there a way to limit the size of > the

Re: File Size Script Help - Working Version

2012-01-03 Thread Igor Dovgiy
Hi folks, happy new year to everyone. ) John, you're right, of course. ) The filenames in nested directories could well overlap, and using $File::Find::name would be safer. Didn't think of that as a big problem, though, as original script (with 'opendir') ignored all the nested folders overall.

Re: File Size Script Help - Working Version

2012-01-03 Thread Brandon McCaig
Hello: On Sat, Dec 31, 2011 at 02:56:50AM +0200, Igor Dovgiy wrote: $filedata{$_} = [$filesize, $filemd5]; *snip* my ($size, $md5) = @{ $filedata{$filename} }; Alternatively, store a nested hash-reference: $filedata{$File::Find::name} = { md5 = $file_md5, size =

Re: File Size Script Help - Working Version

2012-01-02 Thread Jonathan Harris
On Sat, Dec 31, 2011 at 4:29 AM, John W. Krahn jwkr...@shaw.ca wrote: Igor Dovgiy wrote: Great work, Jonathan! Notice how simple your script has become - and that's a good sign as well in Perl. :) We can make it even simpler, however. As you probably know, Perl has two fundamental types of

Re: File Size Script Help - Working Version

2011-12-30 Thread Igor Dovgiy
Hi Jonathan, Argh, really stupid mistake by me. ) But let's use it to explain some points a bit further, shall we? A skilled craftsman knows his tools well, and Perl programmer (with CPAN as THE collection of tools of all sizes and meanings) has an advantage here: even if documentation is a bit

Re: File Size Script Help - Working Version

2011-12-30 Thread Igor Dovgiy
Hi John, yes, good point! Totally forgot this. ) Adding new files to a directory as you browse it is just not right, of course. Possible, but not right. ) I'd solve this by using hash with filenames as keys and collected 'result' strings (with md5 and filesizes) as values, filled by File::Find

Re: File Size Script Help - Working Version

2011-12-30 Thread Jonathan Harris
On Fri, Dec 30, 2011 at 11:58 AM, Igor Dovgiy ivd.pri...@gmail.com wrote: Hi John, yes, good point! Totally forgot this. ) Adding new files to a directory as you browse it is just not right, of course. Possible, but not right. ) I'd solve this by using hash with filenames as keys and

Re: File Size Script Help - Working Version

2011-12-30 Thread Brandon McCaig
On Thu, Dec 29, 2011 at 03:43:19PM +, Jonathan Harris wrote: Hi All Hello Jonathan: (Disclaimer: I stayed up all night playing Skyrim and am running on about 4.5 hours of sleep.. ^_^) I think most things have already been addressed, but I think Igor might have had a bit of trouble making

Re: File Size Script Help - Working Version

2011-12-30 Thread Jonathan Harris
On Fri, Dec 30, 2011 at 7:11 PM, Brandon McCaig bamcc...@gmail.com wrote: On Thu, Dec 29, 2011 at 03:43:19PM +, Jonathan Harris wrote: Hi All Hello Jonathan: (Disclaimer: I stayed up all night playing Skyrim and am running on about 4.5 hours of sleep.. ^_^) I think most things have

Re: File Size Script Help - Working Version

2011-12-30 Thread Igor Dovgiy
Great work, Jonathan! Notice how simple your script has become - and that's a good sign as well in Perl. :) We can make it even simpler, however. As you probably know, Perl has two fundamental types of collections: arrays (where data is stored as a sequence of elements, data chunks) and hashes

Re: File Size Script Help - Working Version

2011-12-30 Thread John W. Krahn
Igor Dovgiy wrote: Great work, Jonathan! Notice how simple your script has become - and that's a good sign as well in Perl. :) We can make it even simpler, however. As you probably know, Perl has two fundamental types of collections: arrays (where data is stored as a sequence of elements, data

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
On Thu, Dec 29, 2011 at 5:08 PM, Igor Dovgiy ivd.pri...@gmail.com wrote: Hi Jonathan, Let's review your script a bit, shall we? ) It's definitely good for a starter, but still has some rough places. #!/usr/bin/perl # md5-test.plx use warnings; use strict; use File::Find; use

Re: File Size Script Help - Working Version

2011-12-29 Thread Igor Dovgiy
Hi Jonathan, Let's review your script a bit, shall we? ) It's definitely good for a starter, but still has some rough places. #!/usr/bin/perl # md5-test.plx use warnings; use strict; use File::Find; use Digest::MD5; use File::Spec; So far, so good. ) my $dir = shift ||

re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
Hi All Firstly, many thanks for your help previously (19/12/11) - it has led to making a useable script I don't think it's brilliantly written, it seems a little bodged together to me... but works fine - not a bad result for a first script If you are new to this problem and are interested in

Re: File Size Script Help - Working Version

2011-12-29 Thread John W. Krahn
Jonathan Harris wrote: Hi Igor Many thanks for your response I have started reviewing the things you said There are some silly mistakes in there - eg not using closedir It's a good lesson in script vigilance I found the part about opening the file handle particularly interesting I had no

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn jwkr...@shaw.ca wrote: Jonathan Harris wrote: Hi Igor Many thanks for your response I have started reviewing the things you said There are some silly mistakes in there - eg not using closedir It's a good lesson in script vigilance I found

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
On Fri, Dec 30, 2011 at 12:33 AM, Jonathan Harris jtnhar...@googlemail.comwrote: On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn jwkr...@shaw.ca wrote: Jonathan Harris wrote: Hi Igor Many thanks for your response I have started reviewing the things you said There are some silly

Re: File Size Script Help - Working Version

2011-12-29 Thread John W. Krahn
Jonathan Harris wrote: On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahnjwkr...@shaw.ca wrote: Igor made a lot of good points. Here are my two cents worth. You are using the File::Find module to traverse the file system and add new files along the way. This _may_ cause problems on some file

Re: File Size Script Help - Working Version

2011-12-29 Thread John W. Krahn
Jonathan Harris wrote: FInally, I was advised by a C programmer to declare all variables at the start of a program to avoid memory issues Is this not necessary in Perl? It is not really necessary in C either. John -- Any intelligent fool can make things bigger and more complex... It takes

re: File Size Script Help

2011-12-19 Thread Jonathan Harris
Hi Perl Pros This is my first call for help I am a totally new, self teaching, Perl hopeful If my approach to this script is simply wrong, please let me know as it will help my learning! The script aims to: 1) Read in a directory either from the command line, or from a default path 2) Produce

Re: File Size Script Help

2011-12-19 Thread Jim Gibson
On 12/19/11 Mon Dec 19, 2011 11:32 AM, Jonathan Harris jtnhar...@googlemail.com scribbled: Hi Perl Pros This is my first call for help I am a totally new, self teaching, Perl hopeful If my approach to this script is simply wrong, please let me know as it will help my learning! The

Re: File Size Script Help

2011-12-19 Thread Shlomi Fish
Hi Jonathan, some comments on your code - both positive and negative. On Mon, 19 Dec 2011 19:32:10 + Jonathan Harris jtnhar...@googlemail.com wrote: Hi Perl Pros This is my first call for help I am a totally new, self teaching, Perl hopeful If my approach to this script is

Re: File Size Script Help

2011-12-19 Thread Jonathan Harris
On Mon, Dec 19, 2011 at 8:08 PM, Jim Gibson jimsgib...@gmail.com wrote: On 12/19/11 Mon Dec 19, 2011 11:32 AM, Jonathan Harris jtnhar...@googlemail.com scribbled: Hi Perl Pros This is my first call for help I am a totally new, self teaching, Perl hopeful If my approach to this

Re: File Size Script Help

2011-12-19 Thread Jonathan Harris
On Mon, Dec 19, 2011 at 8:09 PM, Shlomi Fish shlo...@shlomifish.org wrote: Hi Jonathan, some comments on your code - both positive and negative. On Mon, 19 Dec 2011 19:32:10 + Jonathan Harris jtnhar...@googlemail.com wrote: Hi Perl Pros This is my first call for help I am a

Re: File Size Limit in Archive::Perl

2007-11-10 Thread Rob Dixon
San wrote: Is there any way to limit the file size while zipping using Archive::Zip so that it will stop processing a zip operation on a file list when it crosses the maximum file size. Hey San Unfortunately Archive::Zip requires that an archive be written to disk before the compression is

Re: File Size Calculator

2004-08-10 Thread SilverFox
Jose Alves De Castro wrote: On Mon, 2004-08-09 at 14:53, David Dorward wrote: On 9 Aug 2004, at 14:34, SilverFox wrote: Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the

Re: File Size Calculator

2004-08-10 Thread mgoland
Quickest wya would be to get the left over from begining. ... print Please enter your number:\n; chomp($num=STDIN); $bytes = $num % $kilo; $num -= $bytes ... HTH, Mark G. - Original Message - From: SilverFox [EMAIL PROTECTED] Date: Monday, August 9, 2004 12:06 pm Subject: Re: File

Re: File Size Calculator

2004-08-10 Thread Brian Gerard
And the clouds parted, and SilverFox said... Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in the right direction? Example: user enter: 59443

RE: File Size Calculator

2004-08-10 Thread Charles K. Clarkson
SilverFox [EMAIL PROTECTED] wrote: : : I haven't put anything together as yet. Putting : some if/elsif statement together would be the : easiest way I can think off. Something like: We can see a few problems right off. All scripts should start with 'strict' and 'warnings'. We need a

Re: File Size Calculator

2004-08-10 Thread Brian Gerard
And the clouds parted, and Brian Gerard said... [1] http://www.alcyone.com/max/reference/physics/binary.html -anyone remember offhand the URL to the /. story on these, btw? ...never mind. Found it. (uncaught typo on my first google query... DOH!)

Re: File Size Calculator

2004-08-09 Thread David Dorward
On 9 Aug 2004, at 14:34, SilverFox wrote: Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in the right direction? What have you got so far? Where are you

Re: File Size Calculator

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 14:53, David Dorward wrote: On 9 Aug 2004, at 14:34, SilverFox wrote: Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in

Re: File Size Calculator

2004-08-09 Thread Chris Devers
On Mon, 9 Aug 2004, SilverFox wrote: Example: user enter: 59443 Script will output: 58M I know this isn't getting into the spirit of things, but have you considered simply using the `units` program? % units 500 units, 54 prefixes You have: 59443 bytes You want: megabytes

Re: File size problem

2003-06-28 Thread R. Joseph Newton
Vasudev.K. wrote: Hi, I have this rather critical problem, I am trying to download quite huge files from a remote server through ftp. (The file being in a zipped format). I have an array which stores the names of the files to be downloaded. I am opening each of them up at my end and

RE: File size problem

2003-06-26 Thread Darbesio Eugenio
-Original Message- Vasudev.K. wrote: . Q1. After unzipping, the file is huge (even the zipped one is :(( ).. almost 5GB. The system throws an errorFile too large and exits. How do I get around this ache? One way I want to do it is unzipped file into many parts and process

RE: File size problem

2003-06-26 Thread Vasudev.K.
Ya.. I guess .. I got a part of the answer.. I am unzipping it onto the STDOUT and reading it from there But... still stuck with parallel processing :p:D -Original Message- From: Vasudev.K. [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 1:06 PM To: [EMAIL PROTECTED]

RE: file size

2002-02-22 Thread John Edwards
Upload via FTP? Via a web based form? 18 questions left... John -Original Message- From: anthony [mailto:[EMAIL PROTECTED]] Sent: 22 February 2002 14:22 To: [EMAIL PROTECTED] Subject: file size Hi, I have an upload script, and i want to check the file size before it uploads. Any

Re: file size

2002-02-22 Thread Jon Molin
anthony wrote: Hi, I have an upload script, and i want to check the file size before it uploads. Any suggestion is appreciated Anthony here's some old code that does that, might be something built-in in CGI.pm as well: my $tempFile = CGI::tmpFileName($img_filename); my

Re: file size

2002-02-22 Thread Chris Ball
Anthony == awards anthony writes: Anthony Hi, I have an upload script, and i want to check the file Anthony size before it uploads. The stat() function returns a list that includes file size as the seventh element. You can use: $size = (stat($filename))[7]; ... to retrieve the

Re: file size

2002-02-22 Thread Jeff 'japhy' Pinyan
On Feb 22, Chris Ball said: Anthony == awards anthony writes: Anthony Hi, I have an upload script, and i want to check the file Anthony size before it uploads. The stat() function returns a list that includes file size as the seventh element. You can use: $size =

Re: file size

2002-02-22 Thread anthony
Hi, But i tried this i didn't $size= -s $filename but it didn't work, anyways i want my upload script not to upload files that are bigger than 250Kb Anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: file size

2001-06-21 Thread Me
-s as in: perl -e 'print $_: . -s . \n for (glob (*.*))' Hi, I would like to know if with a perl script you can get the size of a file ? I need to get all the size of 250 files on 250 computers ... thanx

Re: file size

2001-06-21 Thread victor
use the stat command. [EMAIL PROTECTED] wrote: Hi, I would like to know if with a perl script you can get the size of a file ? I need to get all the size of 250 files on 250 computers ... thanx