Mail Archives: djgpp/2007/05/16/15:51:07
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
michelle,
if you have a mailbox in the maildir format, you can definitely
transform it in a directory tree using a recursive run on each of the
subdirs names in the mailbox:
~/Maildir
.INBOX
.INBOX.djgpp
.INBOX.gis
.INBOX.family
.INBOX.family.wife
.INBOX.family.children
.INBOX.family.parents
if you wish to access your very mailbox from dos,
i'd suggest you build the directory tree as you have asked (more on this
below), with the leaves on the tree being links to the real subdirs in
the mailbox.
the directory tree top should be exported as nfs or samba, to be
accessed in dos, simultaneusly with linux.
building the dir tree (on linux):
char *topdestdir = "rmaildir";
mkdir(topdestdir);
for each directory in maildir
{
if (*directory == '.')
{
char *origdir = directory;
char *tmp;
chdir(topdestdir);
while ((tmp = strchr(directory + 1, '.')) != NULL)
{
*tmp = '\0';
if (access(directory + 1, D_OK)
mkdir(directory + 1);
chdir(directory + 1);
directory = tmp;
*tmp = '.'
}
mklink(origdir, directory);
}
}
regards,
alex
Michelle Konzack wrote:
> Am 2007-05-16 18:45:26, schrieb Timo Schlüßler:
>> Do you only need strdup() or strdupa() ?? Why don't you write your own?
>> Like:
>> char *strdup(const char *s)
>> {
>> size_t len = strlen (s) + 1;
>> char *result = (char*) malloc (len);
>> if (result == (char*) 0)
>> return (char*) 0;
>> return (char*) memcpy (result, s, len);
>> }
>>
>> (This is the code for the real strdup() function.)
>>
>> All the best and sorry for writting if this wasn't your real problem
>
> Maybe you are right. I should copy the original function into my code.
> I have only found two functions, which are not available under DJGPP.
>
> Thanks, Greetings and nice Day
> Michelle Konzack
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQCVAwUBRktgjdpwN1sq38njAQKAkwQAuN3fINZnVBUAahEn9V8dndzI3WOJj6FA
b7uF4att+Ap8a6AWQYVBR9XaZsMksXosXuqCoWCttvkGw21IFMMP8wsUEwO1uoRt
VLTkKd4hFg/piE51C97eqY6/Rh3FT1qYuwyy//5pe033vELdlgeozu327bjMTScL
xYPpggQICK0=
=Xu8y
-----END PGP SIGNATURE-----
- Raw text -