|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ReDirect Problem
when I want to redirect output of a program to a file, why does the file appear as an executable after the data has been written to it? Here is the line that opens the file
open(filename,O_WRONLY|O_CREAT|O_TRUNC,S_IRWXU); Thanks! |
|
#2
|
||||
|
||||
|
S_IRWXU means "read, write, execute -- user" and should generate a file mode of 0700.
Read-only for owner is S_IRUSR and write-only is S_IWUSR. You might get the "read & write, but not execute" with (S_IRUSR | S_IWUSR). Otherwise, you might want to set your umask to mask out the execute (umask == 0111). Or call chmod() to turn executable off. |
|
#3
|
|||
|
|||
|
Thanks!
It works I am just using S_IREAD|S_IWRITE.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > ReDirect Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|