Jump to content

P2p Mover


hinfie
 Share

Recommended Posts

I made this script to learn some autoit functions, any comments and/or improvements are welcome.

This script looks in a directory if there are completed files and moves them to an other directory, if the file is in use it just goes on to the next file.

This process will continue every 30 seconds.

You will be informed about completed downloads with a traytip.

:ph34r: Updated after comments: Optional subdirectory move. (No more lost files when moving subdirectories.)

script: P2P file mover.au3

exe: P2P file mover.exe

Playing and learning with Autoit v3

Hinfie

Edited by hinfie
Link to comment
Share on other sites

@kloyenz, That statement is unfair since you did not look at how the script works before just running it like an idiot. If you look at the way the script works, you will see it only moves files to another directory. It does not delete them at all. If you run every program you get before finding out about it first, I have a good feeling you probably have a few viruses on your system. Another thing is that you are not making a very good impression for being a member with only 4 posts so far. Watch what you say and how you say it or you will not be helped if you need support.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

  • Developers

DONT use it as it will delete all directories

<{POST_SNAPBACK}>

Are you sure that directories are deleted ?

I would guess that whole subdirectories from the source directory are moved to the target directory since there's no test for subdirectories in the source path.

@hinfie you might want to add a test to skip directories from moving them by adding this test:

While 1
         $FILE = FileFindNextFile($SEARCH) 
         If @error Then ExitLoop
        ; skip these references
         If $FILE = "." Or $FILE = ".." Then  ContinueLoop
         If StringInstr(FileGetAttrib ($File ),"D") > 0 then ContinueLoop
         $EXTENSION = StringRight($FILE, 3) 
         If $EXTENSION = "dat" Then ContinueLoop

:ph34r:

EDIT: Added the correct directory test...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

yes he moved some of my directories to files but they are fucked up now.

Some files are just gone.

<{POST_SNAPBACK}>

Take a look at the script... It only moves files, not deletes them.

I dont have any virusses

<{POST_SNAPBACK}>

The point was that you seem to run code with no idea what-so-ever of what it does. This is the kind of mentality that gets viruses installed on a computer.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

  • Developers

@Hinfie... the first test i had is just testing for the parent dir... this test is for the subdirs... see the modified post...

If StringInstr(FileGetAttrib ($File ),"D") > 0 then ContinueLoop

:ph34r:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I updated the script that it will skip directories.

Never tried the script with subdirectories, so i did not found this "bug" in the script, i have seen that a directory was not moved but i never checked the contents. :">

Added

$ATTRIB = FileGetAttrib($DOWNLOADLOC & "\" & $FILE)
         If StringInStr($ATTRIB, "D") Then ContinueLoop

to the script, i will work on a option where you can choose if you want to move sub directories.

this-is-me, The script skips the Kazaa dat files..

$EXTENSION = StringRight($FILE, 3) 
         If $EXTENSION = "dat" Then ContinueLoop

P2P mover.au3

P2P mover.exe

Playing and learning with Autoit v3

Hinfie

Edited by hinfie
Link to comment
Share on other sites

  • Developers

yes he moved some of my directories to files but they are fucked up now.

Some files are just gone.

I dont have any virusses

<{POST_SNAPBACK}>

I believe theres a bug in the FileMove command ... see post for the details: http://www.autoitscript.com/forum/index.php?showtopic=4317

:ph34r:

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...