home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
help.jn
/
mymode.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-08-19
|
335 b
|
23 lines
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
mymode(p)
char *p;
{
struct stat buf;
struct stat *pb = &buf;
#ifndef SYSV
if(lstat(p,pb)== -1)
#else
if(stat(p,pb)== -1)
#endif
{
/* fprintf(stderr,"lstat: %s not found\n",p);*/
return 0;
}
/* fprintf(stderr,"mode=%o\n",pb->st_mode);*/
return pb->st_mode;
}