[comp.unix.questions] Changing DIRs to Files...

jnorman@gmuvax2.gmu.edu (Sci-Fi) (09/14/90)

How can one change the file type attibute ???  for instance...


drwxr--r-- to
~rwxr--r--

Is this possible?


-- 
   _    ,           _   ,  jnorman@gmuvax   _jnorman@gmuvax2.gmu.edu/ 
  ' )  /      /    ' ) /      (Bitnet)     // _/_ (Usenet)  _/_    /  
   /--/ _  __/      /-<   ______  _   . . //  /  __.  ____  /     /   
  /  (_</_(_/_     /   ) (_) / <_/_)_(_/_</__<__(_/|_/ / <_<__   o    

cpcahil@virtech.uucp (Conor P. Cahill) (09/19/90)

In article <2284@gmuvax2.gmu.edu> jnorman@gmuvax2.gmu.edu (Sci-Fi) writes:
>How can one change the file type attibute ???  for instance...
>
>drwxr--r-- to
>~rwxr--r--
>

How about cp (like in cp dir file) followed by rm -rf dir; mv file dir

Or if you are really trying to change that bit, you can use fsdb (not
for the light-hearted), or write a quick and dirty program to 
read the raw filesystem to make the change.  To do either of these
things you normally need root access (since mucking around in the 
file system can damage it and cause a system panic).


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

rns@se-sd.SanDiego.NCR.COM (Rick Schubert) (09/20/90)

In <1990Sep19.015106.22922@virtech.uucp> cpcahil@virtech.uucp (Conor P. Cahill) writes:

>In article <2284@gmuvax2.gmu.edu> jnorman@gmuvax2.gmu.edu (Sci-Fi) writes:
>>How can one change the file type attibute ???

>How about cp (like in cp dir file) followed by rm -rf dir; mv file dir

The version of `cp' that runs on our system does not allow this (it complains
that `dir' is a directory).  Instead,
           cat dir >file
should work.

-- Rick Schubert (rns@se-sd.sandiego.NCR.COM)