## NAME

ACE_File_Lock - A wrapper around the UNIX file locking mechanism.

## SYNOPSIS

    #include <ace/Synch.h>

    class ACE_File_Lock
    {
      public:
        ACE_File_Lock (ACE_HANDLE handle = ACE_INVALID_HANDLE);
        ACE_File_Lock (LPCTSTR filename, int flags, mode_t mode = 0);
        int open (LPCTSTR filename, int flags, mode_t mode = 0);
        ~ACE_File_Lock (void);
        int remove (void);
        int acquire (short whence = 0, off_t start = 0, off_t len = 1);
        int tryacquire (short whence = 0, off_t start = 0, off_t len = 1);
        int release (short whence = 0, off_t start = 0, off_t len = 1);
        int acquire_write (
            short whence = 0,
            off_t start = 0,
            off_t len = 1
            );
        int tryacquire_write (
            short whence = 0,
            off_t start = 0,
            off_t len = 1
            );
        int acquire_read (
            short whence = 0,
            off_t start = 0,
            off_t len = 1
            );
        int tryacquire_read (
            short whence = 0,
            off_t start = 0,
            off_t len = 1
            );
        ACE_HANDLE get_handle (void);
        void set_handle (ACE_HANDLE);
        void dump (void) const;
        ACE_ALLOC_HOOK_DECLARE;
      protected:
        ACE_OS::ace_flock_t lock_;
        int removed_;
      private:
        void operator= (const ACE_File_Lock &);
        ACE_File_Lock (const ACE_File_Lock &);
    };

## DESCRIPTION

Wrappers for various synchronization routines.

## Prevent assignment and initialization.

    void operator= (const ACE_File_Lock &);

    ACE_File_Lock (const ACE_File_Lock &);

## AUTHOR

Doug Schmidt

## LIBRARY

ace