Protecting files while written ...

Protecting files while written ...

Post by shar » Thu, 10 Jul 2003 06:11:22



Hi,
Let's say I have a process that creates file and write data into it.
The process will create the file with perm 755
( in result of a default umask 022 ).
At this point all users in the domain will be able to read, copy or
execute the file.
I want to protect the file until the end of the writing process.
Is there a reasonable way to do this ?
( aix 4.33 Ml 8 although it's a traditional Unix Q ).
Thanks

--
Posted via http://dbforums.com

 
 
 

Protecting files while written ...

Post by p.. » Thu, 10 Jul 2003 16:27:37



> Hi,
> Let's say I have a process that creates file and write data into it.
> The process will create the file with perm 755
> ( in result of a default umask 022 ).
> At this point all users in the domain will be able to read, copy or
> execute the file.
> I want to protect the file until the end of the writing process.
> Is there a reasonable way to do this ?
> ( aix 4.33 Ml 8 although it's a traditional Unix Q ).
> Thanks

Create file with open(2) ("file" , O_CREAT| O_RDWR, 006 )

write data, then close(2) chmod(2)

Quote:> --
> Posted via http://dbforums.com

--
Peter H?kanson        
        IPSec  Sverige      ( At Gothenburg Riverside )
           Sorry about my e-mail address, but i'm trying to keep spam out,
           remove "icke-reklam" if you feel for mailing me. Thanx.

 
 
 

1. Writing to write-protected floppy

Some time ago I had to take some files from home to work. I mounted a msdos
floppy (on Linux), copied the files and umounted the floppy. At the umount
the floppy started to whir, so I assumed the files ware written. At work I
found out that the floppy had been write protected, so no files had been
written.

Shouldn't there be some kind of warning? I know that Unix does write
behind, but I would have liked some kind of indication that nothing had
been written. E.g. the mount could have warned about read-only, or mounted
the floppy readonly, so that the write would have gotten an error.
--
Piet* van Oostrum, Dept of Computer Science, Utrecht University,  (*`Pete')
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.

PGP public key by finger or WWW http://www.cs.ruu.nl/~piet

2. insmod es1371 -- Device or resource busy

3. rm in a script deletes write protected files

4. dial-up with attcanada

5. Protecting files while written ...

6. 2.4.5-ac9 console NULL pointer pointer dereference

7. Can one remove write-protected files?

8. Where is the Legato email list at these days?

9. Press Ctrl-D whiling inputting

10. Checking Tape for Write Protect

11. problem: write protected CD-RW?

12. First crash in years -- write-protected floppy?

13. Help! CD-writer write protected