You are not logged in.

#1 2012-01-08 07:46:00

Hspasta
Member
Registered: 2011-12-24
Posts: 189
Website

[SOVLED]Proper creation of directory for program in C

How do you create a directory for a program at $HOME like .mpd?

Is this done in the program or through make? I was looking at the 'mkdir' function provided by 'sys/stat.h', but I could never for some reason have the directory have correct.

Last edited by Hspasta (2012-01-11 02:37:37)

Offline

#2 2012-01-08 17:32:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,334

Re: [SOVLED]Proper creation of directory for program in C

Most programs I have seen do it from with in the program.  What happens when a user wants to start from scratch with your program and rm's the directory?

I looked at some of my code and realized I was writing in Qt which has some nice classes dedicated to this function.  This is not a new problem, I might suggest you look around and see if there exist libraries you might use, rather than re-invent the wheel.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#3 2012-01-09 13:12:00

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOVLED]Proper creation of directory for program in C

See platform_GetConfigDir().

Last edited by stqn (2012-01-09 13:14:14)

Offline

#4 2012-01-11 02:37:28

Hspasta
Member
Registered: 2011-12-24
Posts: 189
Website

Re: [SOVLED]Proper creation of directory for program in C

Thanks for the help!

Offline

Board footer

Powered by FluxBB