Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Store files in a certain dir

 
Post new topic   Reply to topic Printable version
 View previous topic  Smong's hardcore bot? Post :: Post Merv plugin that relays sysop warnings?  View next topic  
Author Message
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Tue Nov 28, 2006 2:11 pm    Post subject: Store files in a certain dir Reply to topic Reply with quote

I was wondering if you can make a mervbot plugin store files in a certain directory.
The way to output data to a textfile i use now is with Streams like:
Code: Show/Hide

ofstream file("database.dat", ios::app);
if (file)
{
   file << "blabla:" << a_string.msg  << endl;
   tell(makeEcho("Database Saved.."));
}
else
{tell(makeEcho("Error Saving Database.."));}   
file.close();

This creates-edits a file in the same dir as the plugin.
But i need it to save in another directory. Like C:/MERVBot/Database instead of C:/MERVBot
Can this be done with stream´s or do i need to use another way?
If so how do you do this?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Tue Nov 28, 2006 3:10 pm    Post subject: Re: Store files in a certain dir Reply to topic Reply with quote

[code]ofstream file("c:\\mervbot\\database\\database.dat", ios::app);[/quote]
The double slashes is just escaping the one slash.
Back to top
View users profile Send private message Add User to Ignore List Send email
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Wed Nov 29, 2006 6:04 am    Post subject: Reply to topic Reply with quote

now i could have found out about that myself.
Ima do that. thanks.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 29, 2006 10:49 am    Post subject: Reply to topic Reply with quote

Of course, to save relative to the MERVBot directory, you'd want to do "database\\database.dat". But I'm sure you could have found that our yourself too.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Wed Nov 29, 2006 1:47 pm    Post subject: Reply to topic Reply with quote

ohyeah and the directory needs to be already created.
Else it will give an error and crate a blank file in the same folder as the plugin. Thanks!
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 323 page(s) served in previous 5 minutes.

phpBB Created this page in 0.439827 seconds : 29 queries executed (94.8%): GZIP compression disabled