Forum: Ruby on Rails FileUtils rename dir name?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D77663a5995b5538aa0bc62e6940e241?d=identicon&s=25 sine serz (sineserz)
on 2006-12-25 14:20
hi

i need to rename a directory when i update category to category name.

i searched methods for FileUtils but found nothing for rename

i dont want to use mv since i need to move every file under directory to
a new directory and then remove old one

isnt there any easier way ?


thanks
3631e726676d6b214ba07d5a1df1bcc7?d=identicon&s=25 shai rosenfeld (Guest)
on 2006-12-25 15:26
sine serz wrote:
> hi
>
> i need to rename a directory when i update category to category name.
>
> i searched methods for FileUtils but found nothing for rename
>
> i dont want to use mv since i need to move every file under directory to
> a new directory and then remove old one
>
> isnt there any easier way ?
>
>
> thanks

can't u do mv and use the wildcard

*

 ?
D77663a5995b5538aa0bc62e6940e241?d=identicon&s=25 sine serz (sineserz)
on 2006-12-25 15:39
shai rosenfeld wrote:
> sine serz wrote:
>> hi
>>
>> i need to rename a directory when i update category to category name.
>>
>> i searched methods for FileUtils but found nothing for rename
>>
>> i dont want to use mv since i need to move every file under directory to
>> a new directory and then remove old one
>>
>> isnt there any easier way ?
>>
>>
>> thanks
>
> can't u do mv and use the wildcard
>
> *
>
>  ?


yes i tried this and its working thanks.

im stuck now, i dont know how to ask if a directory is empty?

I think this is very lame question, but i cannot figure it out.

anyone ?

thanks
3631e726676d6b214ba07d5a1df1bcc7?d=identicon&s=25 shai rosenfeld (Guest)
on 2006-12-25 16:19
This topic is locked and can not be replied to.