Welcome! Log In Create A New Profile

Advanced

[PHP] Copy for directories?

Posted by Jeffry Killen 
Jeffry Killen
[PHP] Copy for directories?
April 22, 2018 07:30AM
Hello:
is there a function for copying a directory, preferably with a recursive option?

Thanks
JK
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tobias Fichtner
AW: [PHP] Copy for directories?
April 22, 2018 10:10AM
Hi,

PHP dont know how to copy a directory.

You have two options. A recursive copy like this in the comments from
Documentation http://php.net/manual/en/function.copy.php#91010 or you use
systemfunctions with system()http://php.net/manual/en/function.system.php or
backticks `copy y z`
http://php.net/manual/en/language.operators.execution.php


Regards,
Tobias





-----Urspr√ľngliche Nachricht-----
Von: Jeffry Killen [mailto:[email protected]]
Gesendet: Sonntag, 22. April 2018 07:24
An: php-general General List
Betreff: [PHP] Copy for directories?

Hello:
is there a function for copying a directory, preferably with a recursive
option?

Thanks
JK
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jigar Dhulla
Re: [PHP] Copy for directories?
April 22, 2018 09:10PM
Nope. Not straightforward. May be this can help.
https://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php


On Sun, Apr 22, 2018 at 10:54 AM, Jeffry Killen <[email protected]>
wrote:

> Hello:
> is there a function for copying a directory, preferably with a recursive
> option?
>
> Thanks
> JK
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
https://about.me/jigar?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=edit_panel&utm_content=thumb
Jigar Dhulla
about.me/jigar
https://about.me/jigar?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=edit_panel&utm_content=thumb
Jeffry Killen
Re: [PHP] Copy for directories?
April 22, 2018 10:00PM
> On Apr 22, 2018, at 12:04 PM, Jigar Dhulla <[email protected]> wrote:
>
> Nope. Not straightforward. May be this can help.
> https://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php
>
>
> On Sun, Apr 22, 2018 at 10:54 AM, Jeffry Killen <[email protected]>
> wrote:
>
>> Hello:
>> is there a function for copying a directory, preferably with a recursive
>> option?
>>
>> Thanks
>> JK
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

Thanks for replies on this question.

I have already written my own recursive functions but
decided to find out if there already was a function available.

I just have to figure out how to use it as a core for copy, remove,
search, and turning over ftp user owned content to server user
ownership by copy, rename and remove
the original.

JK
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Curtis Maurand
Re: [PHP] Copy for directories?
April 23, 2018 03:00AM
Why fight with it? Outsource it to the system and let the system handle the work. It already knows how to do the job. Just trap the result code and you'll know if you're successful or not.

Cheers,
Curtis



On April 22, 2018 3:50:08 PM EDT, Jeffry Killen <[email protected]> wrote:
>
>> On Apr 22, 2018, at 12:04 PM, Jigar Dhulla <[email protected]>
>wrote:
>>
>> Nope. Not straightforward. May be this can help.
>>
>https://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php
>>
>>
>> On Sun, Apr 22, 2018 at 10:54 AM, Jeffry Killen
><[email protected]>
>> wrote:
>>
>>> Hello:
>>> is there a function for copying a directory, preferably with a
>recursive
>>> option?
>>>
>>> Thanks
>>> JK
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>
>Thanks for replies on this question.
>
>I have already written my own recursive functions but
>decided to find out if there already was a function available.
>
>I just have to figure out how to use it as a core for copy, remove,
>search, and turning over ftp user owned content to server user
>ownership by copy, rename and remove
>the original.
>
>JK
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Sorry, only registered users may post in this forum.

Click here to login