Sign in to follow this  
Followers 0
Sven

check for new directories?

2 posts in this topic

Hello,

I'm fairly new to all this coding stuff. I'm trying to solve a problem, but can't think of any way to do it. Thus I could use a lesson or two on how to do the following:

I'm running a gameserver, where a new randomly named subdirectory in the "c:\documents and settings\admin\my game\multiplayer\" folder is created for each new player. What I'd like to do is to make some GUI for switching on and off the function to automatically place a certain file (welcome.txt) into only those randomly named folders that are created after the function (not the GUI) is activated. Sounds complicated? Well, at least it does for me :whistle:

Any help (and maybe some example code) would be greatly appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to the forums Sven!

How about having a file that keeps track of the folders that you've already copied the Welcome text to?

Then when your function starts you could generate a list of folders that exist, and then for each folder that doesn't already exist in your list you could act upon it.

During this mechanism you could also check for folders that exist as entries in your file but not on disk, and delete those dead entries.

Good luck! :whistle:

Edited by LxP

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0