method
socket?
ruby latest stable - Class:
File
socket?(p1)public
Returns true if the named file is a socket.
file_name can be an IO object.
static VALUE
rb_file_socket_p(VALUE obj, VALUE fname)
{
#ifndef S_ISSOCK
# ifdef _S_ISSOCK
# define S_ISSOCK(m) _S_ISSOCK(m)
# else
# ifdef _S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == _S_IFSOCK)
# else
# ifdef S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# endif
# endif
# endif
#endif
#ifdef S_ISSOCK
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
if (S_ISSOCK(st.st_mode)) return Qtrue;
#endif
return Qfalse;
} Related methods
- Instance methods
- atime
- birthtime
- chmod
- chown
- ctime
- flock
- lstat
- mtime
- path
- size
- to_path
- truncate
- Class methods
- absolute_path
- atime
- basename
- birthtime
- blockdev?
- chardev?
- chmod
- chown
- ctime
- delete
- directory?
- dirname
- empty?
- executable?
- executable_real?
- exist?
- exists?
- expand_path
- extname
- file?
- fnmatch
- fnmatch?
- ftype
- grpowned?
- identical?
- join
- lchmod
- lchown
- link
- lstat
- lutime
- mkfifo
- mtime
- new
- open
- owned?
- path
- pipe?
- readable?
- readable_real?
- readlink
- realdirpath
- realpath
- rename
- setgid?
- setuid?
- size
- size?
- socket?
- split
- stat
- sticky?
- symlink
- symlink?
- truncate
- umask
- unlink
- utime
- world_readable?
- world_writable?
- writable?
- writable_real?
- zero?