limor cohen wrote:
> Okay .. if I want to move the directory with the iterator, how do I do it?
> Is that possible?
I'm not sure I understand the question. Are you iterating over a
crack.fs.Path object? If so, we don't currently have a wrapper for the
rename() function, which is what you would need to move a directory under
unix.
Your options are:
1) Add the rename() function to crack/runtime/Init.cc, then add a rename()
wrapper to crack.fs.Path and its implementations. (Then send us the patch and
indicate your willingness to have it distributed under a BSD 2 license with
the rest of Crack :-)
2) Use crack.fs.process to shell out to 'mv'
3) directly import rename from the shared library where it is defined:
import "libc.so.6" rename;
void rename(byteptr s, byteptr d);
rename(CString(file1).buffer, CString(file2r).buffer);
If you're using arbitrary strings, be sure to wrap them in
crack.lang.CString, as these are guaranteed to be null terminated while
arbitrary strings are not.
>
> בתאריך יום שלישי, 4 במרץ 2014 12:20:14 UTC-8, מאת mindhog:
> >
> >
> >
> >
> > On Tue, Mar 4, 2014 at 2:40 PM, limor cohen <
limor...@gmail.com<javascript:>
> >> email to
crack-lang-de...@googlegroups.com <javascript:>.
=============================================================================
michaelMuller =
mmu...@enduden.com |
http://www.mindhog.net/~mmuller
-----------------------------------------------------------------------------
The people can always be brought to the bidding of the leaders. That is easy.
All you have to do is tell them they are being attacked and denounce the
pacifists for lack of patriotism and exposing the country to danger. It works
the same way in any country. - Hermann Goering (Hitler's right-hand man)
=============================================================================