digitalmars.D.learn - copying a directory
- jicman (5/5) May 17 2007 Greetings.
- Gregor Kopp (5/12) May 17 2007 I think, if you want to do a deep copy (recursive), it's just good to
- Regan Heath (7/15) May 18 2007 Not that I recall but I've been away for a while so there might be.
- Frank Benoit (3/3) May 18 2007 sounds like this:
- jicman (12/15) May 21 2007 Yeah, that is beautiful. The problem is that all of my code has been Ph...
- John Reimer (5/23) May 21 2007 The fact that Tango has been in development for well over a year
- jicman (5/8) May 22 2007 I agree. I also have faith. I can also see that it is also becoming a ...
- Manfred Nowak (3/4) May 18 2007 Wasn't it in std.recls?
- jicman (2/5) May 21 2007 It coulda been... :-)
- Regan Heath (4/10) May 18 2007 jicman - In case you're using phobos (and not tango) here is a copyDir u...
- jicman (5/18) May 21 2007 modified to suit the phobos style. Is there an official place to submit...
- jicman (5/5) May 21 2007 Reagan,
- jicman (4/7) May 21 2007 There goes my job... :-) I tried to send this to Regan and somehow go t...
- Regan Heath (3/7) May 22 2007 No problem, expect it soon.
Greetings. Is there a command for std.file to copy a directory? I know that I can use mkdir and then copy all the files in there, but is there any place a copyDir command? thanks.
May 17 2007
I think, if you want to do a deep copy (recursive), it's just good to use existing programs like xcopy on windows, or a linux pendant. You can call these programs from your d-program. Only my thoughts jicman schrieb:Greetings. Is there a command for std.file to copy a directory? I know that I can use mkdir and then copy all the files in there, but is there any place a copyDir command? thanks.
May 17 2007
jicman Wrote:Greetings. Is there a command for std.file to copy a directory? I know that I can use mkdir and then copy all the files in there, but is there any place a copyDir command? thanks.Not that I recall but I've been away for a while so there might be. I think ideally you want a function that uses the API to list files and for each file or directory it calls a callback (function/delegate) to perform the correct operation. This general idea can be re-used for (optionally recursive) copy, delete, and any other change you might want to apply to a group of files and/or directories. I wrote something just like this for my work on installers in the past. You can also abstract out the source of the file listing, getting it from an FTP server, or database, or ... you end up with a library just like Matthew Wilson's one (I forget the name, sorry). Regan Heath
May 18 2007
sounds like this: http://www.dsource.org/projects/tango/wiki/ChapterIO#FilePath See the "toList" function.
May 18 2007
== Quote from Frank Benoit's articlesounds like this: http://www.dsource.org/projects/tango/wiki/ChapterIO#FilePath See the "toList" function.Yeah, that is beautiful. The problem is that all of my code has been Phobos'ed. And I have had bad history with new startup libraries. No disrespect to anyone here nor in the tango team. But, most folks start projects with great enthusiasm, and then, BOOOOM, they either stop, drastically change things or simply disappear. And, by the way, I understand. Time is not what it used to be, so priorities change. :-) Folks around here think that I am crazy, because I started to believe the speed of light is starting to slow down. This means that energy is not what is used to be, so E=MC^2 does not have the pep that it once had. :-) Anyway, I know Walter will keep Phobos going, so I have faith in Phobos. Thanks for the suggestion... josé
May 21 2007
On Tue, 22 May 2007 00:24:10 +0000, jicman wrote:== Quote from Frank Benoit's articleThe fact that Tango has been in development for well over a year (with major parts well over three years) tells me that it has the momentum to keep going. I have complete faith in Tango and it's crew. -JJRsounds like this: http://www.dsource.org/projects/tango/wiki/ChapterIO#FilePath See the "toList" function.Yeah, that is beautiful. The problem is that all of my code has been Phobos'ed. And I have had bad history with new startup libraries. No disrespect to anyone here nor in the tango team. But, most folks start projects with great enthusiasm, and then, BOOOOM, they either stop, drastically change things or simply disappear. And, by the way, I understand. Time is not what it used to be, so priorities change. :-) Folks around here think that I am crazy, because I started to believe the speed of light is starting to slow down. This means that energy is not what is used to be, so E=MC^2 does not have the pep that it once had. :-) Anyway, I know Walter will keep Phobos going, so I have faith in Phobos. Thanks for the suggestion... josé
May 21 2007
== Quote from John Reimer's replyThe fact that Tango has been in development for well over a year (with major parts well over three years) tells me that it has the momentum to keep going. I have complete faith in Tango and it's crew.I agree. I also have faith. I can also see that it is also becoming a more complete than Phobos. Like I said, all of my programs are Phobos based. So, it will take me a while to switch. :-) jic
May 22 2007
jicman wroteis there any place a copyDir command?Wasn't it in std.recls? -manfred
May 18 2007
== Quote from Manfred Nowak's articlejicman wroteIt coulda been... :-)is there any place a copyDir command?Wasn't it in std.recls?
May 21 2007
jicman Wrote:Greetings. Is there a command for std.file to copy a directory? I know that I can use mkdir and then copy all the files in there, but is there any place a copyDir command?jicman - In case you're using phobos (and not tango) here is a copyDir using phobos std.file functions. Walter - please feel free to include these functions in std.file in this form or modified to suit the phobos style. Is there an official place to submit new code for phobos? This code is public domain. I cannot guarantee this code has been fully tested.
May 18 2007
== Quote from Regan Heath's articleThis is a multi-part message in MIME format ------------15658639521179527726 Content-Type: text/plain jicman Wrote:phobos std.file functions.Greetings. Is there a command for std.file to copy a directory? I know that I can use mkdir and then copy all the files in there, but is there any place a copyDir command?jicman - In case you're using phobos (and not tango) here is a copyDir usingWalter - please feel free to include these functions in std.file in this form ormodified to suit the phobos style. Is there an official place to submit new code for phobos?This code is public domain. I cannot guarantee this code has been fully tested.Thank Reagan.
May 21 2007
Reagan, would you mind sending it to me? Somehow I can not download it. Xerox is so stupid carefully with downloading things that it stops us from doing real work. Thanks. josé
May 21 2007
== Quote from jicman's articleReagan, would you mind sending it to me? Somehow I can not download it. Xerox is so stupid carefully with downloading things that it stops us from doing real work.There goes my job... :-) I tried to send this to Regan and somehow go to the newsgroup... Sorry about that folks. Somehow, I forgot to click on the "Do not post". That is why we have "digitalmars.D.learn".
May 21 2007
jicman Wrote:Reagan, would you mind sending it to me? Somehow I can not download it. Xerox is so stupid carefully with downloading things that it stops us from doing real work.No problem, expect it soon. Regan
May 22 2007