help! directories changed into regular files! :(

2006-12-05 Thread martijn
Hi,

I remembered thinking, should i backup the directory tree before this chang? 
nah ;-)

i used sed in a directory with subdirs, and it changed all directories into 
normal files :(

the exact command:

sed -i -e s/'pm_properties\([^a-z]\)/#__properties\1/g' *

after which i discovered it had name the directories name-e and had turned
into regular files. no warnings whatsoever. (btw, yes i know that it should
have been -i.orig)

weird thing is, i can't reproduce the bug, and the command history wasn't big
enough to figure out what was so special about this particular situation... sed
sais 'in-place editing only works for regular files' but this time it didn't

my question though: is there _any_ way to flip the bit that marks the file
being a directory? it would really be helpful to me because i've just lost a
lot of work.

any ideas?

bye
Martijn.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: help! directories changed into regular files! :(

2006-12-05 Thread Andrew Pantyukhin

On 12/5/06, martijn [EMAIL PROTECTED] wrote:

any ideas?


The general idea is that kernel never permits
*any* write access to directory files even if
you have root privileges.

Please check once again, what your problem
might be. Try backing up  your disk with dd
and running fsck, or run fsck on a snapshot.

And please use shorter lines.

Thanks!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: help! directories changed into regular files! :(

2006-12-05 Thread martijn
Hello,

Once upon a Tue, Dec 05 2006, Andrew Pantyukhin hit keys in the following order:
 
 The general idea is that kernel never permits
 *any* write access to directory files even if
 you have root privileges.

well, it happened... i was root atm, in a jail, but i'll try to recreate
the bug...

 Please check once again, what your problem
 might be. Try backing up  your disk with dd
 and running fsck, or run fsck on a snapshot.

too bad its on my live webserver... i can do all this and still get
nowhere, reading from your answer i hit something that is not possible.
so i won't be able to recreate it anyway.. my problem remains the same,
no argueing about it, my directories _did_ turn into files.

 And please use shorter lines.

sorry about that, i forgot to setup my textwith... 72 chars is okay
right?

bye
martijn
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: help! directories changed into regular files! :(

2006-12-05 Thread martijn
Once upon a Tue, Dec 05 2006, martijn hit keys in the following order:
 
 Once upon a Tue, Dec 05 2006, Andrew Pantyukhin hit keys in the
 following order:
  
  The general idea is that kernel never permits *any* write access to
  directory files even if you have root privileges.
 
 well, it happened... i was root atm, in a jail, but i'll try to
 recreate the bug...

One more thing, it happened on a nullfs mounted drive... Could that be
the problem?

martijn
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


KINDA SOLVED: Re: help! directories changed into regular files! :(

2006-12-05 Thread martijn
Heheh, now i can reproduce it ;-)

I did an in-place searchreplace with sed on a bunch of symlinks to
directories, but i didn't remember they were symlinks. When you do that,
the symlink gets backed up as a normal file.

probably not the behauviour we want, but hey, thats live when you give
stupid commands ;-)

martijn.

Once upon a Tue, Dec 05 2006, martijn hit keys in the following order:
 Hi,
 
 I remembered thinking, should i backup the directory tree before this chang? 
 nah ;-)
 
 i used sed in a directory with subdirs, and it changed all directories into 
 normal files :(
 
 the exact command:
 
   sed -i -e s/'pm_properties\([^a-z]\)/#__properties\1/g' *
 
 after which i discovered it had name the directories name-e and had turned
 into regular files. no warnings whatsoever. (btw, yes i know that it should
 have been -i.orig)
 
 weird thing is, i can't reproduce the bug, and the command history wasn't big
 enough to figure out what was so special about this particular situation... 
 sed
 sais 'in-place editing only works for regular files' but this time it 
 didn't
 
 my question though: is there _any_ way to flip the bit that marks the file
 being a directory? it would really be helpful to me because i've just lost a
 lot of work.
 
 any ideas?
 
 bye
 Martijn.
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]