Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Search this Thread
Old 06-09-2009, 08:24 AM   #1
LQ Newbie
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Rep: Reputation: 0
cannot create regular file ...: text file busy


I compield a new bash into /usr/local/bin and want to copy now to /bin, but get above error-message.

I changed default shell to ksh, reboot, checked for any bash-porcess, but nothing to see with ps -ef | grep bash.

As soon, as I try to copy bash, I get above error-message. Why ?

what is meaning of that message ?

how can I overcome that blocking ?

thanks for any tip, laode
Old 06-09-2009, 08:36 AM   #2
LQ Newbie
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Original Poster
Rep: Reputation: 0
cannot create regular file....solved


Problem solved, I wasn't aware that root was using bash as well, when loged in by 'su -'.

thanks anyway, laode
Old 11-26-2012, 10:56 AM   #3
LQ Newbie
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
Overwrite busy files

When a file is opened and locked by a process, any other process is not allowed to write into it, and in particular to completely overwrite it. But anyone (with the necessary rights) can rename it.
Thus the procedure I usually follow in this case is:
  1. rename the old file
  2. copy the new file, with the old name of the existing one
  3. once the file is unlocked, I delete it
Note that after the step 2, the locking process still operates on the renamed file, but any new process will refers to the new one!

Old 11-26-2012, 12:05 PM   #4
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 1,608

Rep: Reputation: 673Reputation: 673Reputation: 673Reputation: 673Reputation: 673Reputation: 673
Originally Posted by MicBert View Post
[*]once the file is unlocked, I delete it
No need to wait. You can remove the file right away. The kernel will keep the old file around on disk until no one is using it.
Old 11-27-2012, 02:56 AM   #5
LQ Newbie
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
It's true, I have just tried. Thanks!

I remembered it is not possible under windows, so I never tried neither under linux.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
scp text file busy error seran Linux - General 3 03-24-2010 10:21 AM
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 10:40 PM
Text file Busy yusufs Linux - Newbie 7 01-05-2008 07:12 AM
cp: cannot create regular file Raakh Linux - Newbie 1 07-17-2007 11:00 AM
/etc/rc.sysinit: /bin/awk: Text file busy teeno Linux - Software 5 02-23-2005 03:19 AM

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration