----- Original Message -----
From: "Leopold Toetsch" <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 12:51 PM
Subject: TWEAKS: Takers Wanted - Effort And Knowledge Sought

> Platform code
> -------------
>We need some functions to deal with paths and files like File::Spec.
>For loading include files or runtime extension some search path should
>be available to locate these files (a la "use lib LIST;").
>For now runtime/parrot/{include,dynext} and the current working
>directory would be sufficient.

I ain't 100% sure what Leo wanted there and afraid that my patch is out of
place.  Though it presets rudimentary support for the Parrot File::Spec-like
functions which are as follows: curdir, catdir, catfile.

I should warn you the patch is a lack of any documentation. Examples of
usage can be found in file_spec.t. Nevetheless does it need writing some
documentation on for non-perl folks and if it does where should I put it in?
The docs directory?

Next. In the future I'll need to be able to do some find 'n' replace
actions in order to clean the trash off of paths. The perl version
uses the regexes like these:

    $path =~ s|/+|/|g unless($^O eq 'cygwin'); # xx////xx  -> xx/xx
    $path =~ s|(/\.)+/|/|g;                              # xx/././xx ->xx/xx
    $path =~ s|^(\./)+||s unless $path eq "./";  # ./xx      -> xx
    $path =~ s|^/(\.\./)+|/|s;                           # /../../xx ->xx
    $path =~ s|/\Z(?!\n)|| unless $path eq "/";# xx/       -> xx

The bodkin is whether I should take advantage of string_str_index,
string_replace and the rest Co or there is a better solution? In any
case it never uses long paths, so we won't be violently penalized while
using any of find 'n' replace sheme.

The last. I beg to be excused I couldn't prepare unified diffs
of file.ops, file_spec.c, file_spec.h, and file_spec.t with
diff -N -u. Alas. The better I got was:

cvs server: I know nothing about file.ops
cvs server: I know nothing about file_spec.c
cvs server: I know nothing about include/parrot/file_spec.h
cvs server: I know nothing about t/op/file_spec.t

Probably -N works only with files that have already been added
or removed and I have no write access to add those files to
the repository. I won't be surprised if "oops! I did something
wrong again".

Comments, requests, threats are welcome, you know.









Attachment: file_spec.diff
Description: Binary data

Attachment: file.ops
Description: Binary data

Attachment: file_spec.c
Description: Binary data

Attachment: file_spec.h
Description: Binary data

Attachment: file_spec.t
Description: Binary data

Reply via email to