home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* ╡{ªí└╔ªW║┘: wat72.c */
- /*------------------------------------------------------------------*/
- #include <sys\stat.h>
- #include <stdio.h>
- #include <time.h>
- #include <fcntl.h>
-
- void main(int argc,char **argv)
- {
- struct stat buf;
- int handle;
-
- if(argc == 1)
- printf("¿╧Ñ╬ñΦ¬k: wat72 <└╔«╫ªW║┘.¬■└╔ªW>\n");
- else if(argc == 2)
- {
- /* ╢}▒╥ñ@¡╙└╔«╫ */
- if ((handle = open(argv[1], O_RDONLY)) == -1)
- {
- fprintf(stderr, "╡L¬k╢}▒╥└╔«╫ %s \n", argv[1]);
- exit(1);
- }
-
- /* ¿·▒oª╣└╔«╫ñº¼█├÷╕Ω░T */
- fstat(handle, &buf);
-
- /* ┼πÑ▄│Q╢╟ª^ñº░T«º */
- if (buf.st_mode & S_IFCHR)
- printf("Ñ╪½eñº└╔«╫▒▒¿ε╜X½Y½ⁿªVñ@¡╙│]│╞.\n");
-
- if (buf.st_mode & S_IFREG)
- printf("Ñ╪½eñº└╔«╫▒▒¿ε╜X½Y½ⁿªVñ@¡╙ñ@»δñº└╔«╫.\n");
-
- if (buf.st_mode & S_IREAD)
- printf("╢╚ñ╣│\\¿╧Ñ╬¬╠┼¬¿·ª╣└╔«╫. \n");
-
- if (buf.st_mode & S_IWRITE)
- printf("ñ╣│\\¿╧Ñ╬¬╠╝gñJª╣└╔«╫. \n");
-
- printf("ª╣└╔«╫⌐╥ªbñº║╧║╨ : %c\n", 'A'+buf.st_dev);
-
- printf("ª╣└╔«╫ñºñjñp(│µª∞:ª∞ñ╕▓╒) : %ld\n",buf.st_size);
-
- printf("ª╣└╔«╫│╠½ßñ@ª╕│Q¡╫º∩ñº«╔╢í : %s\n",ctime(&buf.st_ctime));
-
- /* ├÷│¼ª╣└╔«╫ */
- close(handle);
- }
- }