Access privileges of FIFO


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Access privileges of FIFO
# 1  
Old 11-24-2013
Access privileges of FIFO

What are the default access privileges set for a FIFO.?
How can we change read and write privileges for a FIFO?
what are the commands for this above question ?
# 2  
Old 11-24-2013
The commands are:
Code:
man mkfifo
man chmod

# 3  
Old 11-24-2013
fifo's are nothing more than files. stat (either the system call, or the the stat command (Linux) or ls -l) gives you the same kind of information about the file.

Oddly enough not all OSes give a filesize result that has the same meaning. Which is probably due to implementation differences.
From solaris man page for stat:
Code:
st_size	     For regular files, this is the address of the end of  the
		     file. For block special or character special, this is not
		     defined. See also pipe(2).

Linux stat man page defines no such limitation. (struct stat) st_size works out to be the number of unread bytes living in the fifo when the stat call is made. (See tstat.c p. 283 example code in M Kerrisk 'The LINUX Programming Interface', which is derived originally from Ed 1 of Stevens).

Therefore you can use stat or ls -l to get file metadata information about a fifo.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

FIFO

Hello , I am working on unix FIFO IPC. i have a doubt regarding that. If the fifo is updated(write()) through one process....can we able to send any signal that fifo is updated and ready to get read...to other process.?? (0 Replies)
Discussion started by: Harry443
0 Replies

2. UNIX for Dummies Questions & Answers

User gets "The operation could not be completed because you do not have enough access privileges."

Does anyone know why this could be happening? User tries to save into a directory, but gets the error message. I checked permissions on directory and see the following: drwxrwxr-x 10 root pm 1024 Nov 22 14:46 Folder 1 drwxrwxr-x 10 root pm 1024 Oct 19 ... (1 Reply)
Discussion started by: scrivic
1 Replies

3. Programming

Help With FIFO problem...

=server.c= #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <signal.h> #define MSGSIZE 50 (1 Reply)
Discussion started by: sponge
1 Replies

4. Programming

fifo

Dear friends i'm want to implement a program which one file is split into fragments by the server (by some random size) and sent to some processes, so these processes get randomly the fragments of the original file from the server, then the downloader randomly connects to some of these processes... (0 Replies)
Discussion started by: saman_glorious
0 Replies

5. Programming

How to see a FIFO from all the threads?

Hello C programming fellows!!! I'm doing a program with multiple threads in gnu/linux, ubuntu for beeing precise... This program consist in multiple threads, as logical each thread do different things and communicate to each other using IPC. The problem is that in "process 1" I have a... (1 Reply)
Discussion started by: Sandia_man
1 Replies

6. Programming

help About fifo and thread

hi, my problem is i have 10 thread for produces double two dimensional array these will produces 2d array 400 times ,then i have a thread to takes a two dimensional array then it inverse , and most 10 array can be in the fifo , and threads given takes one by one, now my problem is , i cant... (0 Replies)
Discussion started by: bblackened
0 Replies

7. Programming

FIFO's and asynchronousity?

Hello, I have a FIFO which i would like to open O_WDWR | O_NONBLOCK | O_ASYNC and have a SIGIO signal generated when there is input on the FIFO, but there a re a bunch of bugs surrounding this (like for instance i read somewhere that you have to set O_ASYNC with fcntl etc. is this even... (0 Replies)
Discussion started by: davo666
0 Replies

8. UNIX for Dummies Questions & Answers

Doubts on FIFO

Hi , I m beginner for Unix and i want to use FIFO in my 2 Scripts . I want 1 script to read data from FIFO and other will write into FIFO. Despite reading so many articles/posts i am still unable sunchronize my scripts. My doubts are 1> Do We require both scripts as daemons to use... (0 Replies)
Discussion started by: Akshay
0 Replies

9. Programming

how to use fifo

hi, I have a problem. I've done a lil program which gets from the server the given persons username a personal folder. I made it with a pipe calling popen with a command, but how can i make the same thing using fifo. I make the fifo with mkfifo() func. and than what. How do I tell the sertver using... (3 Replies)
Discussion started by: atticus
3 Replies

10. Programming

FIFO issue

hello i am making a client server program that communicates via FIFOS and i cannot get it to not hang i also am forking exec-ing the client from the server my logic (i will spare you the code ) in the server i make two fifos in my server my file permissions are 0644 i then open both... (1 Reply)
Discussion started by: runawayNinja
1 Replies
Login or Register to Ask a Question