Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
79 user(s) are online (60 user(s) are browsing Forums)

Members: 0
Guests: 79

more...

Headlines

Report message:*
 

Re: Porting to AmigaOS4 thread

Subject: Re: Porting to AmigaOS4 thread
by Capehill on 2021/9/23 12:39:50

@Raziel

I don't know why creating a directory wouldn't work? Maybe its path need some modifications in worst case?

Here is an example from other project which you cannot directly copy-paste but I hope it helps:

static void CreateDirectory(const char * const name)
    {
        
auto lock IDOS->Lock(nameSHARED_LOCK);
        if (
lock) {
            
logging::Debug("Directory '%s' exists already"name);
            
IDOS->UnLock(lock);
            return;
        }

        
lock IDOS->CreateDir(name);
        if (
lock) {
            
logging::Debug("Directory '%s' created"name);
            
IDOS->UnLock(lock);
        } else {
            
logging::Warning("Failed to create '%s'"name);
        }
    }


So the main things here are the check via Lock() and creation part.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project