Welcome Guest.   Make a donation to an author on the site April 23, 2014, 01:53:20 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: monitor folder for max MB and get message  (Read 4301 times)
Candle
Participant
*
Posts: 18

View Profile Give some DonationCredits to this forum member
« on: January 20, 2007, 04:01:21 AM »

I was working on this but not having a lot of luck so will ask if someone gets sometime to maybe do this.
I download a lot of files to one folder and want to burn the folder to dvd disk when it hits about 4 gigs ,so need something to watch it for me and when it hits that size it gives me a message .
« Last Edit: January 20, 2007, 04:18:53 AM by brotherS » Logged
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 20, 2007, 04:29:02 AM »

That sounds real handy!  FYI - sometimes it takes a little while, but you will get help and this will be done.  A bunch of real smart and helpful folks hang out at DC.
« Last Edit: December 08, 2009, 05:28:29 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
Candle
Participant
*
Posts: 18

View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 20, 2007, 04:58:47 AM »

Thanks for the help.
Logged
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 20, 2007, 08:53:53 AM »

Anytime.  smiley
« Last Edit: December 08, 2009, 05:26:12 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
chedabob
Participant
*
Posts: 34


C# Master (if only!!!)

View Profile Give some DonationCredits to this forum member
« Reply #4 on: January 20, 2007, 12:31:51 PM »

I could try this, don't think it would be too hard. Gimme half an hour, and Ill have a look

EDIT: Actually, might take a little longer than expected, I gotta get my head around this silly size method.

EDIT2: So, this is my code so far. Its not tidy or anything, but it works slightly. Could somebody explain why it gives me some stupid value? Like for My Pictures, it gives 1180, when in fact, the closest value it could be is 876kb (the actual value according to windows explorer).

[copy or print]
private void button1_Click(object sender, EventArgs e)
        {
            string input = textBox1.Text.ToString();
            string [] directorylist = null;
            string [] filelist = null;
            directorylist = Directory.GetDirectories(input);
            int counterD = 0;
            int counterF = 0;
            double size = 0;
            if (Directory.Exists(input) == true)
            {
               do
               {
                   filelist = Directory.GetFiles(directorylist[counterD]);
                    do
                    {
                        size = size + filelist[counterF].Length;
                        counterF++;
                    }
                    while (counterF <= filelist.Length - 1);
                    counterF = 0;
                   counterD++;
               } while (counterD <= directorylist.Length - 1);
               MessageBox.Show(size.ToString());
            }
            else
            {
                MessageBox.Show("No such Directory. Check path and try again!");
            }
           
        }
« Last Edit: January 20, 2007, 02:06:50 PM by chedabob » Logged
Candle
Participant
*
Posts: 18

View Profile Give some DonationCredits to this forum member
« Reply #5 on: January 20, 2007, 03:49:17 PM »

Thank you for the help. I guess if it gives the gen size of the folder that would be close.
Most of the files would be zip or rar files .
Logged
chedabob
Participant
*
Posts: 34


C# Master (if only!!!)

View Profile Give some DonationCredits to this forum member
« Reply #6 on: January 20, 2007, 04:06:11 PM »

What Im trying to do is find out where that value is coming from. If its just a simple matter of me expecting it in KB that are 1024 bytes, and its reading them out as 1000bytes in a KB, then Ill just modify the output. Ill do a bit mroe tommorrow.

Do you have any folders within your download folder? Or just files?
Logged
Candle
Participant
*
Posts: 18

View Profile Give some DonationCredits to this forum member
« Reply #7 on: January 20, 2007, 04:16:29 PM »

Yes I guess they maybe a few of what I have open and look at but would just care about the zip, rar and exe files that are there.
Thanks for the help with this.
Logged
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: January 20, 2007, 04:39:14 PM »

I'm looking forward to this too!
« Last Edit: December 08, 2009, 05:30:17 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: January 20, 2007, 09:38:03 PM »

 smiley This should do it.

To compile it, download AutoHotkey.

Skrommel


[copy or print]
;FolderLimit.ahk
;  Shows a message when a folder is bigger than a limit
;Skrommel @2007

folder=C:\Test   ;Folder to count and recurse
limit=4000       ;MBs to watch for
pause=10         ;Seconds to wait beween checks
exit=1           ;1=Exit when limit reached  0=Don't

#NoEnv
#Persistent

1mb:=1024*1024   ;Size of 1MB in Bytes
limit:=limit*1mb

Loop
{
  size=0
  Loop,%folder%\*.*,1,1
    size+=%A_LoopFileSize%
  If size>=%limit%
  {
    MsgBox,% folder . " = " . Floor(size/1mb) . "MB > " . Floor(limit/1mb) . " MB!"
    If exit=1
      ExitApp
  }
  Sleep,% pause*1000
}
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
Candle
Participant
*
Posts: 18

View Profile Give some DonationCredits to this forum member
« Reply #10 on: January 20, 2007, 09:45:50 PM »

Thanks you, I'll add a
[copy or print]
FileSelectFolder, OutputVar [, StartingFolder, Options, Prompt]
to it .
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: January 21, 2007, 07:09:58 AM »

 smiley As usual the simple solution is the best, Candle!

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.035s | Server load: 0.14 ]