Discussion Locked

creation of files and folders

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a couple of questions:
1)How do I create a folder in C++ ?
2)How do I create a file to be used as a data
file that will be stored in the above folder?

2 replies

by valentino

Use MSDN (http://msdn.microsoft.com/) to get help on CreateDirectory (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createdirectory.asp) and CreateFile (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createdirectory.asp) functions.

Just in case, here they are briefly:

BOOL CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

lpPathName - pointer to directory path string;
lpSecurityAttributes - pointer to security descriptor.

HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLEhTemplateFile
);

lpFileName - pointer to name of the file;
dwDesiredAccess - access (read-write) mode (GENERIC_READ, GENERIC_WRITE);
dwShareMode - share mode (FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE);
lpSecurityAttributes - pointer to security attributes;
dwCreationDisposition - how to create (CREATE_NEW, CREATE_ALWAYS, OPEN_EXISTING, OPEN_ALWAYS, TRUNCATE_EXISTING);
dwFlagsAndAttributes - file attributes;
hTemplateFile - handle to file with attributes to copy.

by wildcard27284

one of the programs that i use now is saying that i need a snmpap.DLL file in order to run this so how do i get this file???

This discussion is closed to new replies.