home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD2.img
/
d4xx
/
d457
/
cmanual
/
acm3.lzh
/
AmigaDOS
/
Example2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-12
|
856b
|
32 lines
/* Example 2 */
/* This example demonstrates how to create a directory called */
/* "MyDirectory" on the RAM disk. */
#include <libraries/dos.h>
void main();
void main()
{
/* Declare a FileLock structure: */
struct FileLock *lock;
/* Create a directory on the RAM disk: (The directory will */
/* be locked with an exclusive lock, and must therefore be */
/* unlocked before the program terminates.) */
lock = (struct FileLock *) CreateDir( "RAM:MyDirectory" );
/* If there is no lock, no directory has been created. In */
/* that case, inform the user about the problem and leave: */
if( lock == NULL )
{
printf( "ERROR Could NOT create the new directory!\n" );
exit( 0 );
}
/* Unlock the directory: */
UnLock( lock );
}