FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 07-17-2008, 06:56 PM
"Robert Dailey"
 
Default mkdir: recursive alternative?

Hi,

I'm trying to use mkdir to create something like:

/foo/blah/bar/something

However, 'foo', 'blah', and 'bar' are not guaranteed to exist, so I
need mkdir to recursively create the directories that are not there.
Is there a way to do this? I did a lot of searching on google but I
came up with nothing. Thanks.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-17-2008, 06:57 PM
"Robert Dailey"
 
Default mkdir: recursive alternative?

On Thu, Jul 17, 2008 at 1:56 PM, Robert Dailey <rcdailey@gmail.com> wrote:
> Hi,
>
> I'm trying to use mkdir to create something like:
>
> /foo/blah/bar/something
>
> However, 'foo', 'blah', and 'bar' are not guaranteed to exist, so I
> need mkdir to recursively create the directories that are not there.
> Is there a way to do this? I did a lot of searching on google but I
> came up with nothing. Thanks.
>

Never mind:

mkdir -p

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-17-2008, 07:06 PM
"Steve C. Lamb"
 
Default mkdir: recursive alternative?

On Thu, Jul 17, 2008 at 01:57:23PM -0500, Robert Dailey wrote:
> mkdir -p

Personally I go for

import os
os.makedirs('somemultipartpath')

But that's the pythonista in me.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-17-2008, 07:21 PM
"Verde Denim"
 
Default mkdir: recursive alternative?

On Thu, Jul 17, 2008 at 2:56 PM, Robert Dailey <rcdailey@gmail.com> wrote:

Hi,



I'm trying to use mkdir to create something like:



/foo/blah/bar/something



However, 'foo', 'blah', and 'bar' are not guaranteed to exist, so I

need mkdir to recursively create the directories that are not there.

Is there a way to do this? I did a lot of searching on google but I

came up with nothing. Thanks.
if the path is known, something like
for $word in foo blah bar something
do
if [! -d $word]
** mkdir $word
fi
done

(simple bash script)
Jack

*




--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:16 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org