Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-08-2009, 03:40 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
copylevel()

We have movefile (and even copylevel), so why no copyfile? I'd like to use it to automatically back up some files every few hours.
__________________
Reply With Quote
  #2  
Old 08-09-2009, 03:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Bump because this functionality pretty much already exists for levels. And yes, the title of the thread was supposed to be copyfile().
__________________
Reply With Quote
  #3  
Old 08-09-2009, 04:25 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I concur, as well as some kind of way to monitor how many I/O functions I can use before the I/O spam prevention kicks in.
__________________
Quote:
Reply With Quote
  #4  
Old 08-22-2009, 06:51 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Semi-gravedig. But uh.. this seems pretty straightforward to do on your own? Correct me if I'm not understanding something...

PHP Code:
function copyfile(sourceoutput) {
  
temp.contents.loadlines(temp.source);
  
temp.contents.savelines(temp.output0);

__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #5  
Old 08-22-2009, 07:25 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by LoneAngelIbesu View Post
Semi-gravedig. But uh.. this seems pretty straightforward to do on your own? Correct me if I'm not understanding something...

PHP Code:
function copyfile(sourceoutput) {
  
temp.contents.loadlines(temp.source);
  
temp.contents.savelines(temp.output0);

If you're copying a file like that you'd want to use loadstring() not loadlines(). loadlines() is for text files and stuff, loadstring() loads in a binary format.
__________________
Reply With Quote
  #6  
Old 08-22-2009, 08:01 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Inverness View Post
If you're copying a file like that you'd want to use loadstring() not loadlines(). loadlines() is for text files and stuff, loadstring() loads in a binary format.
I guess the point being that this is something very simple to do...
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #7  
Old 08-22-2009, 08:39 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
I hope you're not going to put backups on the same server...
Reply With Quote
  #8  
Old 08-22-2009, 09:18 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Pelikano View Post
I hope you're not going to put backups on the same server...
I'm guessing he wouldn't be making backups for the purpose you're thinking of. As far as I know, those kind of backups are done routinely by GraalOnline. Chris probably wants to back-up files that are changed frequently. If some errant change occurs, he would be able to restore the pre-error file.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #9  
Old 08-22-2009, 10:42 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by LoneAngelIbesu View Post
I'm guessing he wouldn't be making backups for the purpose you're thinking of. As far as I know, those kind of backups are done routinely by GraalOnline. Chris probably wants to back-up files that are changed frequently. If some errant change occurs, he would be able to restore the pre-error file.
Oh I see, I just remembered the "resetting people on mistake case" xD
Reply With Quote
  #10  
Old 08-22-2009, 11:00 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
Oh I see, I just remembered the "resetting people on mistake case" xD
That would be useful, actually, but what I was thinking of was backing up the SQLite database every few hours, and placing it in some backups/* folder that a staff member can download every day or so. We already keep backups of banks, stock info, etc. on Era's server in case someone accidentally resets ones (a lot less likely now that Hachi no longer works here).

I guess copyfile() can already be done with loadstring/savestring, but it's roundabout and probably far less efficient.
__________________
Reply With Quote
  #11  
Old 08-23-2009, 12:35 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by cbk1994 View Post
I guess copyfile() can already be done with loadstring/savestring, but it's roundabout and probably far less efficient.
It's file I/O no matter which way you do it, so I doubt it's neither more nor less efficient than if it were to be part of the engine.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #12  
Old 08-23-2009, 10:07 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by LoneAngelIbesu View Post
It's file I/O no matter which way you do it, so I doubt it's neither more nor less efficient than if it were to be part of the engine.
agreed, it just... copies the level
Reply With Quote
  #13  
Old 12-20-2009, 01:13 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Bump, would be glad if this existed.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.