It is currently Thu Sep 09, 2010 8:11 am

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 1:32 am 
Site Admin
User avatar

Joined: Wed Dec 26, 2007 12:19 am
Posts: 308
Location: Australia
These are included in DSO 0.73 and on.

Note: Both owners of domain names, and SUBOWNERS of domain names have privileges to use these functions. You can add or remove subowners with the subowners command.

$v = SeverFileCount(domain)
This returns the number of files that exist on the server's file system. (This does not include scripts uploaded to ports of that server)

$v = ServerFileName(filenumber)
This returns the filename of the specified file number. See the remotedir.ds example below to lean how this works.

$v = ServerFileDelete(domain, filename)
Delete the specified file on the specified domain name.

$v = ServerFileDownload(domain, filename)
Download the file directly into the variable.

$v = ServerFileUpload(domain, filename)
Update a file directly to the remote file system.


REMOTEUPLOAD domain filename -- upload a file to a domain.
REMOTEDIR domain -- list files on a domain
REMOTEDELETE domain filename -- delete a file from a domain




Here is an example of a script which lists files on the remote file system of your domain name. It is embedded in future releases of DSO.

remotedir.ds

Code:
SAY Correct usage: REMOTEDIR [domain]{lgreen}
SAY DOWNLOADING files on $1{green}

$j=serverfilecount($1)
waitfor $j

FOR $o = 1 to $j

   $fname=serverfilename($1,$o)
   waitfor $fname
   say File $o is $fname

NEXT

SAY File List Complete.





Here is an example of how to delete a file on a remote file system.

remotedelete.ds

Code:
SAY Usage: REMOTEDELETE [domain] [filename]{lgreen}
SAY Deleting $2 on $1...{green}
$j=serverfiledelete($1,$2)
waitfor $j
SAY $j

_________________
The #1 Dark Signs Online Coder
Email me: terminal@darksignsonline.com


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 1:38 am 
Developer
User avatar

Joined: Sat Dec 29, 2007 10:15 am
Posts: 946
Location: Australia
In the later example, what would $j contain if the delete was successfull or if it failed? 0 and 1?

_________________
Image


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 1:42 am 
Site Admin
User avatar

Joined: Wed Dec 26, 2007 12:19 am
Posts: 308
Location: Australia
BigBob85 wrote:
In the later example, what would $j contain if the delete was successfull or if it failed? 0 and 1?


File System Updated.

or

File Not Found.

_________________
The #1 Dark Signs Online Coder
Email me: terminal@darksignsonline.com


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 1:48 am 

Joined: Tue Jan 01, 2008 12:22 am
Posts: 77
isn't serverfiledownload kinda redundant?
and also, do these work for everyone or just the owner?


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 2:02 am 
Site Admin
User avatar

Joined: Wed Dec 26, 2007 12:19 am
Posts: 308
Location: Australia
download wrote:
isn't serverfiledownload kinda redundant?
and also, do these work for everyone or just the owner?



ServerFileDownload might be a tad redundant.

These work for the owner and subowners of a domain.

_________________
The #1 Dark Signs Online Coder
Email me: terminal@darksignsonline.com


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 4:24 am 
Site Admin
User avatar

Joined: Wed Dec 26, 2007 12:19 am
Posts: 308
Location: Australia
:!:


Attachments:
remoteeg.png
remoteeg.png [ 10.3 KiB | Viewed 1518 times ]

_________________
The #1 Dark Signs Online Coder
Email me: terminal@darksignsonline.com
Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 4:51 am 

Joined: Tue Jan 01, 2008 4:45 am
Posts: 42
will there be any way that the users(Not the owner) can interact wth the server???
aka file downloading displaying info(that is stored in a file on the server) and such?


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 4:53 am 

Joined: Tue Jan 01, 2008 4:45 am
Posts: 42
cuz if it isnt then we are basicly kinda making a server only 4 ourself to interact with...


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 4:59 am 
Site Admin
User avatar

Joined: Wed Dec 26, 2007 12:19 am
Posts: 308
Location: Australia
r33d33m33r wrote:
will there be any way that the users(Not the owner) can interact wth the server???
aka file downloading displaying info(that is stored in a file on the server) and such?


I'll be thinking about how to implement this.

_________________
The #1 Dark Signs Online Coder
Email me: terminal@darksignsonline.com


Offline
 Profile  
 
 Post subject: Re: New Remote SERVER FILE functions and commands
PostPosted: Thu Jan 10, 2008 5:11 am 
Developer
User avatar

Joined: Sat Dec 29, 2007 10:15 am
Posts: 946
Location: Australia
If you want users to interact with the server in such a way, set them as SUBOWNER.

_________________
Image


Offline
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron