This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Create Directory


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-31-2009 , 22:53   Create Directory
Reply With Quote #1

Hey, could somebody explain the mode variables regarding this native?

I tried CreateDirectory(MyDir, _); and the compiler gave me an error saying the 2nd arg has no default. but the api kinda tells you that it does. CreateDirectory

I would try to give it the 2nd arg that it needs but i have no idea where to find what its looking for.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
Lord Canistra
Senior Member
Join Date: Mar 2009
Location: Tallinn, Estonia
Old 01-01-2010 , 05:22   Re: Create Directory
Reply With Quote #2

I never did use the function before, but it seems to work well with permissions given as enum.

PHP Code:
enum dirMode
{
    
o=777,
    
g=777,
    
u=777
}

public 
OnPluginStart()
{
    
CreateDirectory("somedir"dirMode)

The path is relative to mod directory.
__________________
Lord Canistra is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 01-01-2010 , 15:30   Re: Create Directory
Reply With Quote #3

thx alot lord, that worked.

Edit:
it doesnt seem right to have a global enum that will only be used once. there must be another way. my general coding knowledge fails again. ill use your method for now. thx again.

Edit2: nvm i figured it out (i think). i found what appear to be bit values in the api file. i just added them all up which i think will be the same permissions as what you posted. please correct me if im wrong! but its working so far.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.

Last edited by meng; 01-01-2010 at 16:59.
meng is offline
Send a message via Yahoo to meng
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 -4. The time now is 03:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode