Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Update: Marc (distribution author) has fixed it in version 4.6, now the example works as expected, will test it more ("async file operations", rather than just "aio_utime") later.

Looks like async file operations are popular topic; I also was trying, recently, to replace what I'm using with something more elegant. However, async file copy (aio_copy) fails, at the step (see description) of changing file atime and mtime. So it can be reduced to failure of aio_utime.

use strict; use warnings; use feature 'say'; use AnyEvent; use AnyEvent::IO; my $c = AnyEvent-> condvar; aio_utime( 'x', 0, 0, sub { $c-> send( @_ )}); say $c-> recv;

File named 'x' is in current directory, IO::AIO and AnyEvent::AIO should be installed. The above example works in Linux, but not in Windows (where actual script is to be used). Perl dies silently in Win10, or with usual OS messagebox "Application needs to be closed blah-blah" in e.g. Win2008.

I found that if this line is replaced with

int i; printf( "calling\n" ); i = utime (filename, &buf); printf( "called\n" ); return i;

then I only see "calling", and process crashes. A call to "utime" looks quite innocent, of course it works from either simple C program or wrapped into Perl and Inline::C. Apart from reporting a bug, perhaps there is some simple and quick fix?


In reply to Failure with IO::AIO (Update: fixed in version 4.6) by vr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-20 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found