/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that opens a file then closes it. */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main() {
    int fildes;
    
    /* open file for reading only */
    if((fildes = open("close.c",O_RDONLY)) == -1){ 
        printf("cannot open file\n");
        exit(1);
    }
    if(close(fildes) == -1) 
        printf("error in closing file\n");
    else
	printf("closed successfully\n");
}
