[perl #35391] [TODO] filepath manipulations

0 views
Skip to first unread message

Leopold Toetsch

unread,
May 10, 2005, 8:13:48 AM5/10/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Leopold Toetsch
# Please include the string: [perl #35391]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=35391 >


During changes related to #34994 I did introduce 3 const cast warnings,
which are just symptoms of a deeper problem (besides that I'm never
sure, what should be const and what not;).

We have e.g:

opcode load_bytecode (in STR)

STRING $1 => char *file

...
Parrot_locate_runtime_file( ... char *file_name)

STRING *runtime_prefix => char *prefix
concat(prefix, file_name) which needs malloc
char *full_name => STRING *str

Parrot_stat_info_intval( ... STRING *file)

=> char *filename stat(2)

Well, doesn't look really like an overview, but we have several
string_to_cstring() and string_from_cstring() calls plus
mem_sys_allocate and strcat.

It was already discussed some time ago that we should have some
interface functions for this, which would also get rid of the mess
above. See also "The Perl 6 Summary for the week ending 20030907"
or google for "Path::Class parrot".

As a starter an equivalent of File::Spec::catfile() would suffice to be
able to rewrite above code.

Comments and proposals welcome,
leo

Jerry Gay via RT

unread,
Nov 11, 2005, 2:44:33 PM11/11/05
to perl6-i...@perl.org
forgot to copy p6i

> [particle - Fri Nov 11 11:41:28 2005]:
>
> > [leo - Tue May 10 05:13:47 2005]:
> [above code snipped]


> > As a starter an equivalent of File::Spec::catfile() would suffice to be
> > able to rewrite above code.
> >

> File::Spec::catdir() has been implemented for win32. catfile() is coming
> soon. stay tuned for unix implementations, which should follow.
>
> ~jerry
>

Reply all
Reply to author
Forward
0 new messages