Sign in to follow this  
Followers 0
sim

filegetsize path in system32 folder

9 posts in this topic

hi

i want to get size of file in system32 folder but getfilesize not support into directories any way to get size into folder

Share this post


Link to post
Share on other sites



Read the sizes of each item within the folder including subdirectories. You'll need to write a recursive function to do this.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

okay thanks

$TotalSize = DirGetSize(@SystemDir,FileGetSize('myfile.txt'))
if $TotalSize > 200000 Then
FileDelete(@SystemDir&"\"&'myfile.txt')
EndIf

now its not getting correct file size of myfile.txt

have any idea to get correct size of file

Edited by sim

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

any one like to give solution for this

$TotalSize = DirGetSize(@SystemDir,FileGetSize('myfile.txt'))
if $TotalSize > 200000 Then
FileDelete(@SystemDir&"\"&'myfile.txt')
EndIf

i want to get correct file size in directory

Edited by sim

Share this post


Link to post
Share on other sites

any one like to give solution for this

$TotalSize = DirGetSize(@SystemDir,FileGetSize('myfile.txt'))
if $TotalSize > 200000 Then
FileDelete(@SystemDir&"\"&'myfile.txt')
EndIf

i want to get correct file size in directory

<{POST_SNAPBACK}>

solution is:

1) write out what you want to do.

2)write out steps you would take to accomplish goal manually, ie: what information you need to gather, add up blah blah blah. write these steps down in the order that you would want them performed, if any decisions need to be made in the process, make sure to write the criteria on which the results of those decisions will be based.

3) using that list of steps, or what we call an "Algorithm" research the helpfile to find functions for each step, and write out your code.

i'd help you more, but i don't like you, and i think that advice above if followed should be more than enough help. The only reason i'm replying at all is because i'm giving you the benefit of the doubt and assuming you've given up on your mailicious programming efforts and are trying now to really learn something useful.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

cameronsdad u must dissmissed by board

i'd help you more, but i don't like you

this is support forum not ur personal disscussion forum if u dont want to help people then ignore them dont send about personal at forum

u dont have manner how to post threads

Edited by sim

Share this post


Link to post
Share on other sites

cameronsdad u must dissmissed by board

this is support forum not ur personal disscussion forum if u dont want to help people then ignore them dont send about personal at forum

u dont have manner how to post threads

<{POST_SNAPBACK}>

i did provide help. which is more than i had to do. as far as any personal commentary i feel like adding to my post, that's at my discretion. i'm not putting anything offensive, and you don't have to read it or take my advice if you don't want to.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

okay thanks

$TotalSize = DirGetSize(@SystemDir,FileGetSize('myfile.txt'))
if $TotalSize > 200000 Then
FileDelete(@SystemDir&"\"&'myfile.txt')
EndIf

now its not getting correct file size of myfile.txt 

have any idea to get correct size of file

<{POST_SNAPBACK}>

Hey sim, that's not going to work! LxP pointed out, that you'll need to write a recursive function to do this. So, try this....

$TotalSize = DirGetSize(@SystemDir,DirGetSize(@SystemDir))

You see: Recursion! A function calls itself !! That should do the "trick" :whistle:

Seriously, you should read a book about programming, otherwise you might hurt yourself while trying to code something!

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

My _RegClone function shows how recursion is implemented. Notice how it calls itself on subkeys so that it can process their values and subkeys.

any one like to give solution for this

$TotalSize = DirGetSize(@SystemDir,FileGetSize('myfile.txt'))
if $TotalSize > 200000 Then
FileDelete(@SystemDir&"\"&'myfile.txt')
EndIf

i want to get correct file size in directory

<{POST_SNAPBACK}>

Surely you will not really try to delete every file above 200KB in a user's System folder? :whistle:

For what it's worth, @SystemDir & "\" & 'myfile.txt' is equivalent to @SystemDir & "\myfile.txt" and because you only issue one command within your If..EndIf block, you don't need to span it across three lines --

if (condition == true) then
    runMyCommand()
endIf

; is equivalent to the following:

if (condition == true) then runMyCommand()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0