Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

        def make_sparse_file(size):
    fd, filename = tempfile.mkstemp(suffix='.md')
    os.fdopen(fd).close()
    run(["dd", "if=/dev/zero", "of=%s" % filename, "bs=1", "count=0", "seek=%Ld" % size])
    return filename
        


src/d/r/drbd-manager-HEAD/drbdadm.py   drbd-manager(Download)
        sectors = util.block_device_sectors(disk)
        mdsize = size_needed_for_md(bytes_per_sector, sectors)
        self.md_file = util.make_sparse_file(mdsize)
        l = losetup.Loop()
        self.loop = l.add(self.md_file)
    def setUp(self):
        self.size = 16L * 1024L * 1024L * 1024L
        self.file = util.make_sparse_file(self.size)
        self.losetup = losetup.Loop()
        self.disk = self.losetup.add(self.file)
    def setUp(self):
        self.size = 16L * 1024L * 1024L * 1024L
        self.file = util.make_sparse_file(self.size)
        self.losetup = losetup.Loop()
        self.disk = self.losetup.add(self.file)

src/d/r/drbd-manager-HEAD/losetup.py   drbd-manager(Download)
    def setUp(self):
        self.filename1 = util.make_sparse_file(16L * 1024L * 1024L)
        self.filename2 = util.make_sparse_file(16L * 1024L * 1024L)
    def tearDown(self):
        os.unlink(self.filename1)