Hi all... wondering if anyone has some quick scripting ideas to create a button that would automate the following... I have the following folder structures:
The E:\ARCHIVE\APE folder hasa series of artist\album sub-directories whose contents I would like to copy/move into the series of archive_00x folders up until 4.3 GB. The archive_00x folders are to serve as staging folders for offloading the contents to DVD...
Any suggestions on what sort of scriptint to use are welcome.
I almost have a PHP command line script finished.
It might not work in a drive letter root Dir yet and it assumes that there are no Dirs in the Albums folders.
I have to add the Dopusrt yet, and rename Archive_xxx to a numbered archives as they pop off the two dimensional array.
However, it is echoing the correct output paths.
The whitespace is stripped out here by Xoops and it's still a debug version, but you can get an idea of what it looks like.
It runs fast enogh too .
Perhaps tomorrow afternoon I'll get it copying files.
Well gee Porc... thanks for putting so much thought and work into it... I'm obligated to tell you I have no experience with PHP, but appreciate the effort and may as well use your effort as an 'excuse' to start putzing with it. Any tips on what to download? I'm assuming I need some sort of PHP run-time environment to make use of such a script? Am I right in thinking that such scripting is covered in php.net's "Using PHP from the command line" documentation?
My pleasure Steje. There's a bug in it though.
It doesn't do a partial disk right. It's easy to fix.
You know I couldn't resist a challenge like that,
besides it gives my a chance to show just how powerful and easy PHP really is.
This script runs only on PHP5 as the scandir() function is new in PHP5.
It was done differently in PHP4, but this is easy and is all that's needed here.
OK, here what you need to get started.
Go to http://www.php.net/downloads.php#v5 and under Windows Binaries, download the PHP 5.0.5 zip package.
You can also download the Collection of PECL modules ( dll libraries ) , but you do NOT need them at this point.
You do NOT need the PHP 5.0.5 Installer !!!
Even if you eventually add Apache and MySQL, you do NOT need the PHP 5.0.5 installer !
Unzip PHP 5.0.5 to a Directory and add that Directory to your path in MSConfig .
If you ommit the path, you'll have to specify the path to PHP.exe each time you make a new button.
Rename php.ini-recommended to php.ini .
Open php.ini in your text editor.
Go to line 353 and change display_errors = Off to display_errors = On . Save the change.
Yes .
Too run the program your button is :
PHP.exe -f path\to\script.php
I have a working version !
It still has a couple of very minor bugs.
I doubt it will work for Artist\Albums in a Drive Letter's root .
I cheated on the Archive index. As long as the number is to be at the end of the Dirname Archive_xxx it will work .
I have the copy function working for both DOS and DOpus .
The default is DOpus. If you want to try DOS, uncomment the commented lines .... it's obvious.
Oh yes, the media size has to be set.
It is in bytes and is on line 6 of the script.