It appears you have not yet registered with our community. To register please click here.

Origin XT RPG Network Home







XT Project Introduction
Blah blah intro to this place. To be composed later.

File CHMOD'er


Jan 17 2007, 10:38 PM (Post #1)
Not Odd anymore
* * * * * * * * * *
Posts: 45,875
Cash: 1,915,578 / 1,817,041,051
Group: Administrator
Joined: 7/10/02 09:48 PM
CODE
<!-- FTP-powered file-chmodder: see http://originxt.com/node/15528 --><ol><?php
$ftp_server = "ftp.originxt.com";
$ftp_user = "origin";
$ftp_pass = "---";
$chmod_dir = "/public_html/data";
$chmod_val = "0666";

// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");

// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass))
{
$arr = ftp_nlist($conn_id, $chmod_dir);

foreach($arr as $k=>$v)
{
echo "<li>Successfully CHMOD'ed $chmod_dir/$v to $chmod_val</li>\n";
ftp_site($conn_id, "CHMOD $chmod_val $chmod_dir/$v");
}
}
else
{
echo "Couldn't connect as $ftp_user\n";
}
?></ol>

This code logs into $ftp_server with $ftp_user and $ftp_pass (change them!) and CHMODs all the files and folders in $chmod_dir to $chmod_val. I used this to temporarily CHMOD all the files in my HTML folder so I can run a PHP script editing them. Use it wisely and strategically to save time stongue.gif
Post Options

 
Jan 18 2007, 08:16 AM (Post #2)
F├╝hrer of the Boards
* * * * * * *
Posts: 4,926
Cash: 257,920 / 71,934
Group: Nobility
Joined: 10/06/04 01:27 AM
I don't know what is more strange. The fact that I can read it, or the fact I think I may actually use it.
Post Options

Jan 18 2007, 09:41 PM (Post #3)
Not Odd anymore
* * * * * * * * * *
Posts: 45,875
Cash: 1,915,578 / 1,817,041,051
Group: Administrator
Joined: 7/10/02 09:48 PM
You might use it? stongue.gif Awesome.
Post Options