#include <FILE.h>
Inheritance diagram for ACE_FILE:


Public Methods | |
| int | close (void) |
| Close the ACE_FILE handle without removing the ACE_FILE from the file system. More... | |
| int | remove (void) |
| Close and remove the ACE_FILE from the file system. More... | |
| int | unlink (void) |
| Remove the ACE_FILE from the file system without closing the ACE_FILE handle. More... | |
| int | get_info (ACE_FILE_Info *finfo) |
| Get information on this ACE_FILE. More... | |
| int | get_info (ACE_FILE_Info &finfo) |
| Get information on this <ACE_FILE>. More... | |
| int | truncate (off_t length) |
| Set filesize to length byte. More... | |
| off_t | seek (off_t offset, int whence=SEEK_CUR) |
| off_t | position (long offset, int startpos) |
| off_t | tell (void) |
| Return an offset for the file handle. More... | |
| off_t | position (void) |
| int | disable (int signum) const |
| int | get_local_addr (ACE_Addr &) const |
| Return the local endpoint address in the referenced ACE_Addr. Returns 0 if successful, else -1. More... | |
| int | get_remote_addr (ACE_Addr &) const |
| Return the same thing as get_local_addr(). More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Protected Methods | |
| ACE_FILE (void) | |
| Ensure that this class is only created by the ACE_FILE_Connector. More... | |
Protected Attributes | |
| ACE_FILE_Addr | addr_ |
| File we are "connected" with... More... | |
Definition at line 61 of file FILE.h.
|
|
Ensure that this class is only created by the ACE_FILE_Connector.
Definition at line 27 of file FILE.cpp. References ACE_TRACE.
00028 {
00029 ACE_TRACE ("ACE_FILE::ACE_FILE");
00030 }
|
|
|
Close the ACE_FILE handle without removing the ACE_FILE from the file system.
Definition at line 35 of file FILE.cpp. References ACE_TRACE, ACE_OS::close, ACE_IO_SAP::get_handle, and ACE_IO_SAP::set_handle. Referenced by remove.
00036 {
00037 ACE_TRACE ("ACE_FILE::close");
00038 int result = 0;
00039
00040 if (this->get_handle () != ACE_INVALID_HANDLE)
00041 {
00042 result = ACE_OS::close (this->get_handle ());
00043 this->set_handle (ACE_INVALID_HANDLE);
00044 }
00045 return result;
00046 }
|
|
|
Disable signal signum This is here to prevent Win32 from disabling SPIPE using socket calls Reimplemented from ACE_IO_SAP. Definition at line 7 of file FILE.i. References ACE_IO_SAP::disable.
00008 {
00009 #if defined (ACE_WIN32)
00010 ACE_UNUSED_ARG (signum) ;
00011 return 0 ;
00012 #else /* ACE_WIN32 */
00013 return ACE_IO_SAP::disable (signum) ;
00014 #endif /* ACE_WIN32 */
00015 }
|
|
|
Dump the state of an object.
Reimplemented from ACE_IO_SAP. Reimplemented in ACE_FILE_IO. Definition at line 19 of file FILE.cpp. References ACE_TRACE, and ACE_IO_SAP::dump.
00020 {
00021 ACE_TRACE ("ACE_FILE::dump");
00022 ACE_IO_SAP::dump ();
00023 }
|
|
|
Get information on this <ACE_FILE>.
Definition at line 68 of file FILE.cpp. References ACE_TRACE, and get_info.
|
|
|
Get information on this ACE_FILE.
Definition at line 49 of file FILE.cpp. References ACE_stat, ACE_TRACE, ACE_OS::fstat, ACE_FILE_Info::mode_, ACE_FILE_Info::nlink_, and ACE_FILE_Info::size_. Referenced by get_info.
00050 {
00051 ACE_TRACE ("ACE_FILE::get_info");
00052 ACE_stat filestatus;
00053
00054 int result = ACE_OS::fstat (this->get_handle (),
00055 &filestatus);
00056
00057 if (result == 0)
00058 {
00059 finfo->mode_ = filestatus.st_mode;
00060 finfo->nlink_ = filestatus.st_nlink;
00061 finfo->size_ = filestatus.st_size;
00062 }
00063
00064 return result;
00065 }
|
|
|
Return the local endpoint address in the referenced ACE_Addr. Returns 0 if successful, else -1.
Definition at line 114 of file FILE.cpp. References ACE_TRACE, and addr_. Referenced by get_remote_addr.
00115 {
00116 ACE_TRACE ("ACE_FILE::get_local_addr");
00117
00118 // Perform the downcast since <addr> had better be an
00119 // <ACE_FILE_Addr>.
00120 ACE_FILE_Addr *file_addr =
00121 ACE_dynamic_cast (ACE_FILE_Addr *, &addr);
00122
00123 if (file_addr == 0)
00124 return -1;
00125 else
00126 {
00127 *file_addr = this->addr_;
00128 return 0;
00129 }
00130 }
|
|
|
Return the same thing as get_local_addr().
Definition at line 135 of file FILE.cpp. References ACE_TRACE, and get_local_addr.
00136 {
00137 ACE_TRACE ("ACE_FILE::get_remote_addr");
00138
00139 return this->get_local_addr (addr);
00140 }
|
|
|
Definition at line 105 of file FILE.cpp. References ACE_TRACE, and tell.
|
|
||||||||||||
|
Definition at line 91 of file FILE.cpp. References ACE_TRACE, and seek.
|
|
|
Close and remove the ACE_FILE from the file system.
Definition at line 143 of file FILE.cpp. References ACE_TRACE, close, and ACE_OS::unlink.
00144 {
00145 ACE_TRACE ("ACE_FILE::remove");
00146
00147 this->close ();
00148 return ACE_OS::unlink (this->addr_.get_path_name ());
00149 }
|
|
||||||||||||
|
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. Same as <seek>, but <position> is deprecated. Definition at line 83 of file FILE.cpp. References ACE_OS::lseek. Referenced by position.
00084 {
00085 return ACE_OS::lseek (this->get_handle (),
00086 offset,
00087 startpos);
00088 }
|
|
|
Return an offset for the file handle.
Definition at line 98 of file FILE.cpp. References ACE_TRACE, and ACE_OS::lseek. Referenced by position.
00099 {
00100 ACE_TRACE ("ACE_FILE::tell");
00101 return ACE_OS::lseek (this->get_handle (), 0, SEEK_CUR);
00102 }
|
|
|
Set filesize to length byte.
Definition at line 76 of file FILE.cpp. References ACE_TRACE, and ACE_OS::ftruncate.
00077 {
00078 ACE_TRACE ("ACE_FILE::truncate");
00079 return ACE_OS::ftruncate (this->get_handle(), length);
00080 }
|
|
|
Remove the ACE_FILE from the file system without closing the ACE_FILE handle.
Definition at line 152 of file FILE.cpp. References ACE_TRACE, and ACE_OS::unlink.
00153 {
00154 ACE_TRACE ("ACE_FILE::unlink");
00155
00156 return ACE_OS::unlink (this->addr_.get_path_name ());
00157 }
|
|
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_IO_SAP. Reimplemented in ACE_FILE_IO. |
|
|
File we are "connected" with...
Definition at line 135 of file FILE.h. Referenced by ACE_FILE_Connector::connect, ACE_FILE_IO::dump, and get_local_addr. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002