Newsgroup: it.comp.lang.c++
Titolo: Creare una cartella.

Salve,
so di essere OT, ma forse i.c.p.win32 era eccessivo. Cmq:
Qual'è la libreria da includere e la funzione da usare per creare una
cartella?
Uso windows.
Grazie
Luigi

Uso windows.
The CreateDirectory function creates a new directory. If the
underlying file system supports security on files and directories, the
function applies a specified security descriptor to the new directory.
Note that CreateDirectory does not have a template parameter, while
CreateDirectoryEx does.
BOOL CreateDirectory(
    LPCTSTR lpPathName,	// pointer to a directory path string
    LPSECURITY_ATTRIBUTES lpSecurityAttributes 	// pointer to a
security descriptor 
   );	
 
Parameters
lpPathName
Points to a null-terminated string that specifies the path of the
directory to be created. 
There is a default string size limit for paths of MAX_PATH characters.
This limit is related to how the CreateDirectory function parses
paths. 
Windows NT: An application can transcend this limit and send in paths
longer than MAX_PATH characters by calling the wide (W) version of
CreateDirectory and prepending "\\?\" to the path. The "\\?\" tells
the function to turn off path parsing; it lets paths longer than
MAX_PATH be used with CreateDirectoryW. This also works with UNC
names. The "\\?\" is ignored as part of the path. For example,
"\\?\C:\myworld\private" is seen as "C:\myworld\private", and "
\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as
"\\bill_g_1\hotstuff\coolapps".
lpSecurityAttributes
Pointer to a SECURITY_ATTRIBUTES structure that determines whether the
returned handle can be inherited by child processes. If
lpSecurityAttributes is NULL, the handle cannot be inherited. 
Windows NT: The lpSecurityDescriptor member of the structure specifies
a security descriptor for the new directory. If lpSecurityAttributes
is NULL, the directory gets a default security descriptor. The target
file system must support security on files and directories for this
parameter to have an effect.
Windows 95: The lpSecurityDescriptor member of the structure is
ignored.
 
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError. 
Remarks
Windows NT: Some file systems, such as NTFS, support compression for
individual files and directories. On volumes formatted for such a file
system, a new directory inherits the compression attribute of its
parent directory. 
Windows NT: An application can obtain a handle to a directory by
calling CreateFile with the FILE_FLAG_BACKUP_SEMANTICS flag set. For a
code example, see CreateFile.
See Also
CreateDirectoryEx, CreateFile, RemoveDirectory, SECURITY_ATTRIBUTES 

so di essere OT, ma forse i.c.p.win32 era eccessivo. Cmq:
No. icpw32 non era affatto eccessivo.
-- 
Andrea Laforgia - walkietalkie(at)
libero.it

Non ci sarebbe un'alternativa alle API?
Se no, come si usano?
Devo mettere direttamente
CreateDirectory ("Fold",???)  // il 2° parametro non l'ho capito
senza includere niente?
Grazie
Luigi

Se no, come si usano?
Segui il sentiero dorato del follow-up... segui il sentiero
dorato... segui il sentiero dorato... segui il sentiero
dorato... segui i......


 senza includere niente?
Secondo te quale potrebbe essere il NG in cui chiedere informazioni sulla
libreria specifica della piattaforma windows, sapendo che tale libreria si
chiama Win32?
--
Andrea Ferro
---------
Brainbench C++ Master. Scored higher than 97% of previous takers
Scores: Overall 4.46, Conceptual 5.0, Problem-Solving 5.0
More info 
http://www.brainbench.com/transcript.jsp?pid=2522556

Umh... it.sesso.racconti???
Luigi