File: shebang.pl

package info (click to toggle)
nbdkit 1.46.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,504 kB
  • sloc: ansic: 63,658; sh: 18,717; makefile: 6,814; python: 1,848; cpp: 1,143; perl: 504; ml: 504; tcl: 62
file content (31 lines) | stat: -rwxr-xr-x 379 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!../nbdkit perl

use strict;

my $disk = "\0" x (1024*1024);

sub open
{
    my $readonly = shift;
    my $h = { readonly => $readonly };
    return $h;
}

sub close
{
    my $h = shift;
}

sub get_size
{
    my $h = shift;
    return length ($disk);
}

sub pread
{
    my $h = shift;
    my $count = shift;
    my $offset = shift;
    return substr ($disk, $offset, $count);
}