LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2009, 08:37 AM   #1
pratikvimal
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Rep: Reputation: 0
Cannot Create or Copy Directory


Hi,
I'm not able to copy a directory into other by giving the following command

"pratik@ubuntu:/opt/tinyos-2.x/apps$ cp -R Blink BlinkTask"
cp: cannot create directory `BlinkTask': Permission denied

Please let me know the solution.

Regards,
Pratik
 
Old 06-09-2009, 08:41 AM   #2
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Rep: Reputation: 31
do you own the folder you are currently working in?

Code:
sudo chmod ugo+w /opt/tinyos-2.x/apps
This will allow anyone on your system to write files to that directory including create directories
 
Old 06-09-2009, 08:43 AM   #3
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi, the directory must exist.

first type...

mkdir BlinkTask

If you still get access denied, then you may not have permission to
create anything on that part of the disk. Or, your out of disk space.

Try...

su (enter admin (root) password)

mkdir BlinkTask

cp -R Blink BlinkTask

see how you go, Regards Glenn

Sorry, Jimbo1708, you're not wrong ;-)

Last edited by GlennsPref; 06-09-2009 at 08:45 AM. Reason: Did not see previous answer by Jimbo1708.
 
Old 06-09-2009, 08:46 AM   #4
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Rep: Reputation: 31
Quote:
Originally Posted by GlennsPref View Post
Hi, the directory must exist.

first type...

mkdir BlinkTask

If you still get access denied, then you may not have permission to
create anything on that part of the disk. Or, your out of disk space.

Try...

su (enter admin (root) password)

mkdir BlinkTask

cp -R Blink BlinkTask

see how you go, Regards Glenn
He's getting the

Quote:
cp: cannot create directory `BlinkTask': Permission denied
which means that the directory exists, but the permissions are bad. He may also need to change the rights on the BlinkTask directory

Code:
sudo chmod ugo+w /opt/tinyos-2.x/apps/BlinkTask
 
Old 06-09-2009, 09:06 AM   #5
pratikvimal
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Thank You.

It's working now.
 
Old 06-09-2009, 09:13 AM   #6
saivin
Member
 
Registered: Dec 2008
Location: Bengaluru, India
Distribution: CentOS, openSUSE, Mandriva, Slackware
Posts: 111

Rep: Reputation: 19
Quote:
Originally Posted by GlennsPref View Post
Hi, the directory must exist.
Not necessarily.
Code:
saivin@sv-debian:~/Lab$ ls -l
total 4
drwxr-xr-x 2 saivin saivin 4096 2009-06-09 18:26 test
saivin@sv-debian:~/Lab$ cp -r test test1
saivin@sv-debian:~/Lab$ ls -l
total 8
drwxr-xr-x 2 saivin saivin 4096 2009-06-09 18:26 test
drwxr-xr-x 2 saivin saivin 4096 2009-06-09 18:38 test1
saivin@sv-debian:~/Lab$
OP was trying to cp inside /opt which is owned by root. By his prompt, it looks like he uses ubuntu. So,
Code:
sudo cp -r Blink BlinkTask
inside that directory would have helped.

Last edited by saivin; 06-09-2009 at 09:14 AM.
 
Old 06-09-2009, 10:13 AM   #7
pratikvimal
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Hello,
I'm getting another error while compiling a directory.
Command: make micaz

Error:
mkdir -p build/micaz
mkdir: cannot create directory `build': Permission denied
make: *** [builddir] Error 1

Solution please.
 
Old 06-09-2009, 10:30 AM   #8
pratikvimal
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Problem solved
 
Old 06-09-2009, 11:47 AM   #9
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
You shouldn't change the permissions in /opt- whilst these are only the 'optional' packages, its never a good idea to give those permissions to a directory where often used binaries are.

Why didn't you try to sudo it? Though to be fair, are you sure you even needed to do that?
 
Old 06-10-2009, 04:52 AM   #10
saivin
Member
 
Registered: Dec 2008
Location: Bengaluru, India
Distribution: CentOS, openSUSE, Mandriva, Slackware
Posts: 111

Rep: Reputation: 19
Quote:
Originally Posted by pratikvimal View Post
Hello,
I'm getting another error while compiling a directory.
Command: make micaz
Pratik, what exactly are you trying to do? I've never heard about 'compiling' a directory. You compile a program, in preparation for making it a binary package.
Quote:
Originally Posted by pratikvimal View Post
Error:
mkdir -p build/micaz
mkdir: cannot create directory `build': Permission denied
make: *** [builddir] Error 1
Solution please.
AFAIK, the directory should exist if you want to create a directory inside it (subdirectory). Again, you may be in a directory where you, as a normal user, do not have write permission.
 
Old 06-10-2009, 10:41 AM   #11
pratikvimal
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
@Saivin
Actually I'm working on tinyos. In Tinyos you cannot compile a signle file inside a directory, rather it compiles all the files inside the directory. May be wrong selection of words.
 
Old 06-10-2009, 07:43 PM   #12
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Me too, sorry all 'round. I missed the finer point.

I'll stay out of this, you guys have it sorted.

Thank you, Glenn
 
Old 06-10-2009, 09:03 PM   #13
saivin
Member
 
Registered: Dec 2008
Location: Bengaluru, India
Distribution: CentOS, openSUSE, Mandriva, Slackware
Posts: 111

Rep: Reputation: 19
Quote:
Originally Posted by GlennsPref View Post
Me too, sorry all 'round. I missed the finer point.
I'll stay out of this, you guys have it sorted.
Thank you, Glenn
What made you think so Glenn. Did we say anything wrong (without intention ofcourse)? Your guidance is always appreciated.

But then, as for as this thread goes, even I join you in saying 'I will stay out of this..' Coz, I just skimmed through the TinyOS site (not to be confused with TinyCore linux). Its about 'wireless embedded sensor networks'. Its a specialised field. Infact it did not even mention that it is 'specialised linux' or 'linux based' or something like that.. Using linux is one of the _official_ methods of installing it if I have understood correctly.

Pratik,
we should always give some background information related to our problems. That helps both. Don't know if you have done it already but have you gone through their site? Particularly
1. Installation of TinyOs in Ubuntu
2. Installing in Xubuntu:Step by Step
3. The Simplest TinyOS Program
4. Blink:An Example Application

Read between the lines. You should also go through their FAQ and Mailing lists.

Sorry, thats all help I can be. Good luck.

Last edited by saivin; 06-10-2009 at 09:23 PM.
 
Old 06-12-2009, 04:23 AM   #14
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi, Saivin, no offence taken, I realised quickly that I had missed the /opt Point, and also realised that this was not the "usual compile" I have dealt with. So I backed out.

Sometimes I'm guilty of jumping in too fast to find it's too deep (for me).

Cheers, and thanks for your concern, kind regards Glenn.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 12:26 PM
How to copy and create path (directory) if necessary... crions Linux - Newbie 5 04-12-2009 08:54 AM
How to copy files after search in array from this directory to another directory! phanvinhgiap Programming 4 01-04-2009 07:48 PM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 12:51 PM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 07:57 AM


All times are GMT -5. The time now is 02:43 PM.

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