Results 1 to 5 of 5

Thread: [RESOLVED] Get File Size

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Resolved [RESOLVED] Get File Size

    Hello.
    I was thinking to make a program that will turn off my computer X minutes after a download has finished (while I sleep).
    The only problem is to make the program know that the download has finished, and I was thinking about turning off few minutes after the file gets to a particular size. I alredy tried programs that can perform this but they didnt work well. Getting the size of the file (not the exact size of course) will solve the problem.

    I'll give you an example for calling a function that returns the file size to label:
    Code:
    Label1.Caption = GetFileSize("C:\Downloads\DownloadedFile.exe")
    Then we will see this on label caption (example):
    1,257,895,908 bytes
    or 1.2GB, or 1200mb I dont mind.

    Any ideas for a function or some code? Thanks.

  2. #2
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759

    Re: Get File Size

    Use

    Code:
    Label1.Caption = FileLen("C:\Downloads\DownloadedFile.exe")

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: Get File Size

    Thank you. I knew there were something simple like this but didnt know exactly. Resolved.

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: [RESOLVED] Get File Size

    Depends on the implementation details of the download which you didn't mention... there are implementations wherein the file size is already set initially and the bits are simply overwritten, e.g. bittorrent.

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: [RESOLVED] Get File Size

    leinad31: Yes, you are right. But its not a big problem and i'll keep an eye on that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width