Re: how can i save a file with RWX access for UGO using ofstream.



On Mar 28, 8:30 pm, SM Ryan <wyrm...@tango-sierra-oscar-foxtrot-
tango.fake.org> wrote:
"nass" <athanasios.si...@xxxxxxxxx> wrote:

# hello everyone,
# im loooking into how to save a file that is RW accessible to ALL .
# but i haven't found any reference in ofstream that gives me that
# ability.

If you can get the file designator, you can call fchmod(fd,0777).
In C you can get that from a FILE* with fileno(file). I would guess
C++ has a similar call on its streams, but I don't know what.

well using ofstream to make the file and then close, reopen it to get
an fd, fchmod and close... seems abit of non trivial disk using time..
so.. i was hoping there is some ofstream open() call that i didn't
know of that can actually accept file access flags like the open() fn
in linux.

nass

.



Relevant Pages

  • Assigning to a reference
    ... want my reference member to refer to a new object; ... corresponds to ofstream and foo_t corresponds to one of my application ... I need to contain an ofstream for logging, and I need to be able ...
    (comp.lang.cpp)
  • Assigning to references
    ... want my reference member to refer to a new object; ... corresponds to ofstream and foo_t corresponds to one of my application ... I need to contain an ofstream for logging, and I need to be able ...
    (comp.lang.cpp)
  • Re: how can i save a file with RWX access for UGO using ofstream.
    ... # im loooking into how to save a file that is RW accessible to ALL. ... BE OPENED AFTER FIRST PERIOD ...
    (comp.unix.programmer)
  • Re: how can i save a file with RWX access for UGO using ofstream.
    ... # well using ofstream to make the file and then close, ... fight with umask, if I'm concerned about the file mode, I just call ...
    (comp.unix.programmer)