Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

Need help with C++ streams

Old 05-17-06, 09:20 AM
  #1  
DVD Talk Special Edition
Thread Starter
 
Join Date: Jan 2001
Location: New York, N.Y.
Posts: 1,708
Need help with C++ streams

I need to open a file for appending and if the file is opened for the first create, it needs to be created with the permissions 666 (read/write for everyone).

I have the following:

ofstream LogFile;
Logfile.open("somefilename",ios::app)

but it creates it with the permissions 644. How do I get it to create with permissions 666?
timewaster is offline  
Old 05-17-06, 06:54 PM
  #2  
DVD Talk Hero
 
Join Date: Aug 2000
Location: Bartertown due to it having a better economy than where I really live, Buffalo NY
Posts: 29,699
http://developers.sun.com/prodtech/c...fstream.3.html
mikehunt is offline  
Old 05-18-06, 11:20 AM
  #3  
DVD Talk Special Edition
Thread Starter
 
Join Date: Jan 2001
Location: New York, N.Y.
Posts: 1,708
Thanks for the link.
I tried the following:

Logfile.open("somefilename",ios::app,0666)
but it still creates it with 644.
Maybe the umask is overridding it?
timewaster is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive Advertising Cookie Policy Privacy Statement Terms of Service

Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.