---
name: "ACE_FILE"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_FILE"
---

# ACE\_FILE(3)

Defines the core methods of the ACE\_FILE abstraction.

## NAME

ACE\_FILE -  Defines the core methods of the ACE\_FILE abstraction.

## SYNOPSIS

```
#include <ace/FILE.h>
class ACE_FILE : public ACE_IO_SAP
{
  public:
    int close (void);
    int remove (void);
    int unlink (void);
    int get_info (ACE_FILE_Info *finfo);
    int get_info (ACE_FILE_Info &finfo);
    int truncate (off_t length);
    off_t seek (off_t offset, int whence = SEEK_CUR);
    off_t position (long offset, int startpos);
    off_t tell (void);
    off_t position (void);
    int disable (int signum) const;
    int get_local_addr (ACE_Addr &) const;
    int get_remote_addr (ACE_Addr &) const;
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  protected:
    ACE_FILE (void);
    ACE_FILE_Addr addr_;
};
```

## PUBLIC MEMBERS

```
int close (void);
```

Close the ACE\_FILE handle without removing the ACE\_FILE from the file system.

```
int remove (void);
```

Close and remove the ACE\_FILE from the file system.

```
int unlink (void);
```

Remove the ACE\_FILE from the file system without closing the ACE\_FILE handle.

```
int get_info (ACE_FILE_Info *finfo);
```

Get information on this ACE\_FILE.

```
int get_info (ACE_FILE_Info &finfo);
```

Get information on this ACE\_FILE.

```
int truncate (off_t length);
```

Set filesize to length byte.

```
off_t seek (off_t offset, int whence = SEEK_CUR);
```

Sets the file pointer as follows:\
    o If whence is SEEK\_SET, the pointer is set to offset\
      bytes.

   o  If whence is SEEK\_CUR, the pointer is set to its\
       current location plus offset.

   o  If whence is SEEK\_END, the pointer is set to the size\
       of the file plus offset.

```
off_t position (long offset, int startpos);
```

Same as seek, but position is deprecated.

```
off_t tell (void);
```

Return an offset for the file handle.

```
off_t position (void);
```

Same as tell, but position is deprecated.

```
int disable (int signum) const;
```

Disable signal signum This is here to prevent Win32 from disabling SPIPE using socket calls

```
int get_local_addr (ACE_Addr &) const;
```

Return the local endpoint address in the referenced ACE\_Addr. Returns 0 if successful, else -1.

```
int get_remote_addr (ACE_Addr &) const;
```

Return the same thing as get\_local\_addr.

```
void dump (void) const;
```

Dump the state of an object.

```
ACE_ALLOC_HOOK_DECLARE;
```

Declare the dynamic allocation hooks.

## PROTECTED MEMBERS

```
ACE_FILE (void);
```

Ensure that this class is only created by the ACE\_FILE\_Connector.

```
ACE_FILE_Addr addr_;
```

File we are "connected" with...

## AUTHOR

Gerhard Lenzer

## LIBRARY

ace
