Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-11-2005, 11:20 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
copy a directory link with -Rs

i have a directory that i need to copy into symbolic links. the problem is that the copy doesn't work for directories.

example, here is the contents of my directory:
- index.php
- images/

of course there are more files, but this will do for now. i'm going to have to copy the contents of this directory often, and i need it to make the symbolic link to the images directory too.

cp -Rs /home/usr/myapp/* ./

that will only copy the symbolic link for all the files. the thing is that i want the directory images/ to be a symbolic link too.

instead, it creates a directory named images that is not a symbolic link, but all the files in the images directory are links.

maybe it doesn't matter that much, but i want to effectively do the same thing that: ln -s /home/usr/myapp/images would do.

any ideas?
__________________
Mike
sde is offline   Reply With Quote
Old 02-12-2005, 12:05 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
part 2: .. so when i do a link directory to the directory, .. the directory is a link, but when i do a ls -la * inside one of those linked directories, none of them is links.

i guess that is because i'm already inside the linked directory.

so what way would be 'proper' ? lol .. i need to put more thought into this.
__________________
Mike
sde is offline   Reply With Quote
Old 02-12-2005, 07:21 AM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,711
redhead is on a distinguished road
One thing comes to mind.. cp -a or perhaps cp -rl or cp -rs
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 02-15-2005, 05:34 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
'cp -rH'
teknomage1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembelly code register addressing toblerone Assembly 5 05-22-2006 02:53 AM
get the size of a directory and its contents sde Linux / BSD / OS X 6 10-06-2004 04:55 AM
'Submit Your Site' page/link directory SiteTutor Lounge 0 06-23-2002 06:48 PM


All times are GMT -8. The time now is 03:50 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting