Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » DirectoryCreateMulti as an alternative for RealizeDirectory
Re: DirectoryCreateMulti as an alternative for RealizeDirectory [message #19559 is a reply to message #19558] Mon, 15 December 2008 17:47 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
luzr wrote on Mon, 15 December 2008 21:08


Good points, thanks.

#ifdef POSIX
bool RealizeDirectory(const String& d, int mode)
#else
bool RealizeDirectory(const String& d)
#endif
{
	String dir = NormalizePath(d);
	Vector<String> p;
	while(dir.GetLength() > DIR_MIN) {
		p.Add(dir);
		dir = GetFileFolder(dir);
	}
	for(int i = p.GetCount() - 1; i >= 0; i--)
		if(!DirectoryExists(p[i]))
#ifdef POSIX
			if(!DirectoryCreate(p[i], mode))
#else
			if(!DirectoryCreate(p[i]))
#endif
				return false;
	return true;
}


Mirek




Thank you, Mirek.

[Updated on: Mon, 15 December 2008 21:58]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Added Signals package
Next Topic: Cairo
Goto Forum:
  


Current Time: Sun May 12 08:21:47 CEST 2024

Total time taken to generate the page: 0.02063 seconds