fchmod() 
Author Message
 fchmod()

I'm porting an app from Unix to NT. I need to get fchmod() to compile and
work. Here is some sample code:
int filehandle;
...
filehandle = _open(filename, O_RDWR | O_CREAT | O_BINARY );
...
fchmod(filehandle, S_IRUSR | S_IWUSR );

Microsoft supports chmod() but requires a filename as a parameter rather
than the file handle. I need to pass it the file handle.

Any ideas?

Thanks,
James



Tue, 14 Oct 2003 06:46:45 GMT  
 fchmod()

Quote:
> I'm porting an app from Unix to NT. I need to get fchmod() to compile and
> work. Here is some sample code:
> int filehandle;
> ...
> filehandle = _open(filename, O_RDWR | O_CREAT | O_BINARY );
> ...
> fchmod(filehandle, S_IRUSR | S_IWUSR );

> Microsoft supports chmod() but requires a filename as a parameter rather
> than the file handle. I need to pass it the file handle.

This is a non-standard function that MS apparently do not support (and
neither do all UNIX flavours). From your code example it seems you have the
filename so I can't see why you don't use chmod(). Also, it seems a bit
weird to change the permissions on an open file - perhaps the logic of the
app you are porting is not quite right.

NeilB



Tue, 14 Oct 2003 07:15:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to implement fchmod

2. HELP: fchmod function cannot compile

3. Can one simulate ftruncate() and fchmod() ?

 

 
Powered by phpBB® Forum Software