Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion C<stat> opcode and interface
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Josh Wilmes  
View profile  
 More options Mar 10 2004, 1:50 pm
Newsgroups: perl.perl6.internals
From: j...@hitchhiker.org (Josh Wilmes)
Date: Wed, 10 Mar 2004 12:53:16 -0500
Local: Wed, Mar 10 2004 12:53 pm
Subject: Re: [PROPOSAL] C<stat> opcode and interface
I have no opinion either way on this opcode or the date/time ones, but I
would like to remind folks about miniparrot- if we want it to work again,
there needs to be a smooth way to exclude opcodes or PMCs which are
not expecially portable on its platform (pure c89, no threads, etc).

This means one or more of the following will need to be done:
   - all non-c89 code in config/gen/platform
   - extra flag in the .ops files to identify ops to be excluded
   - extra file to list explicitly which ops should be INcluded in
     miniparrot, with all others left out.  
   - more #ifdef MINIPARROTs.

Personally i'm leaning towards the third option, but I think we should be
clear what the policy is with regard to config/gen/platform and functions
which aren't part of standard C (but which are available on most
platforms).

It's also quite possible that miniparrot is a waste of time.  I'm pretty
much of the opinion myself that it's an academic exercise at this point,
but one which keeps us honest, even if we don't use it.

--Josh

--Josh

At 11:39 on 03/10/2004 +0100, Leopold Toetsch <l...@toetsch.at> wrote:

> Proposal C<stat> opcode and interface

> 1) ops

>    stat (out PMC, in STR, in INT)
>    stat (out PMC, in PMC, in INT)

> Return a new array-like[1] PMC $1 with file stats from file (PIO or
> string) $2,
> or PerlUndef, if file doesn't exist, $3 are flags:

>    .PARROT_STAT_NO_FOLLOW_LINK

> The array(-like)  has keyed access with these keys

>    .PARROT_STAT_FILE_SIZE
>    .PARROT_STAT_FILE_SIZE_LO
>    .PARROT_STAT_FILE_SIZE_HI

>    .PARROT_STAT_MODE a bitmask with these bits:
>       .PARROT_STAT_MODE_ISDIR
>       .PARROT_STAT_MODE_ISFILE
>       [ more platform-unspecific bits ]

>    .PARROT_STAT_PERM a bitmask with these bits
>       .PARROT_STAT_PERM_IS_READABLE
>       .PARROT_STAT_PERM_IS_WRITABLE
>       .PARROT_STAT_PERM_IS_EXECUTABLE

>    .PARROT_STAT_MTIME modified time

>    .PARROT_STAT_OS_TYPE a constant defining the os-specific
>       part that follows
>         .PARROT_STAT_stat
>         .PARROT_STAT_stat64
>         ...

>    .PARROT_STAT_OS_SPECIFIC
>        A (Un)?ManagedStruct PMC with OS-specific data like a
>         struct stat64

> 2) Interface

>     PMC* Parrot_stat_s(Interp*, STRING* file, INTVAL flags);
>     PMC* Parrot_stat_p(Interp*, PMC*    pio,  INTVAL flags);

> 3) Interface to platforms

>     INTVAL Parrot_stat_os_s(Interp*, Parrot_stat*, STRING* file, INTVAL
> flags);
>     INTVAL Parrot_stat_os_p(Interp*, Parrot_stat*, PMC*    pio,  INTVAL
> flags);

>     typedef struct _parrot_stat {
>        size64_t size;
>        UINTVAL mode;
>        UINTVAL perm;
>        FLOATVAL mtime;  // in Parrot units
>        UINTVAL os_stat_type;
>        union {
>          struct stat;
>    struct stat64;
>    ...
>       } u;
>     } Parrot_stat;

> 4) Notes
> The information in the first few fields should not be platform
> specific. If platforms have more in common then above bits, the
> structure should be expanded.

> [1] it needs just these vtables implemeted: I0 = P0[i], N0 = P0[i],
> i.e. get_{integer,number}_keyed_int

> Comments, improvements, and implementations thereafter welcome
> leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.