LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   what is a socket file?? (https://www.linuxquestions.org/questions/linux-distributions-5/what-is-a-socket-file-256378/)

augustus123 11-18-2004 07:07 AM

what is a socket file??
 
Hi all,

I was new to Linux...

I was not able to understand :

what is a socket file & symbolic links file?

what's the purpose of these 2 files?

Thanks
Augustus
:confused:

acid_kewpie 11-18-2004 07:22 AM

a symbolic link is pretty much a "shortcut" like in windows, but unlike windows, these are real genuine parts of a vaild filesystem, not a silly little ".lnk" file.it let's you access a single file from multiple locations. another kind of link that you can make with the "ln" command is a hard link. a hard link is where there are actually two entries in a file systems FAT table which go to the same memory location, as opposed to a symlink where one file points to another. with a hard link you can actually delete the original file, but as other links will remain, it is still available elsewhere. very handy

a socket file is used to pass information between applications amongst other applications. you may already be familiar with a pipe, "|" which lets you feed information directly, e.g. "ls | wc". Here, wc will count the number of lines from the output of ls. now a socket file is used when you can't join these two directly, and instead send the data to a special file. try this:
Code:

mkfifo /tmp/testfifo
tail -f /tmp/testfifo

and in another console
Code:

echo HELLO! > /tmp/testfifo
the tail command should say HELLO! to you. Think of it kinda like a wormhole or something. again useful when you really need to do it.

augustus123 11-18-2004 07:43 AM

Thats great...
Thank You very much

GinEric 12-06-2004 10:41 PM

mkfifo creates a file of type "pipe" now, how do you create a file of type "socket"

btw, KDE's dangerous "change file type" changes all files associated not with the ending, or any thing else, but it changes all of the types on the entire machine!

This kde command needs fixin, bad!


All times are GMT -5. The time now is 07:38 AM.