Jump to content

filegetsize path in system32 folder


sim
 Share

Recommended Posts

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
Link to comment
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

Edited by sim
Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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.
Link to comment
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 *

Link to comment
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()
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...