24/7 Support: 800.608.6482

Get Started

Developer Docs

file_read_bytes

MivaScript Builtin Function, Miva Merchant 9+

Tag / Description

file_read_bytes( path, location, offset, length, data )

<mvt:assign name="g.return_value" value="file_read_bytes( path, location, offset, length, data )" />

Reads a portion of the file specified by "path" and "location" into "data". Returns the number of bytes read, which may be less than "length", if an attempt was made to read past the end of the file, or -1 on error.

Parameters

  • path

    The name or filepath of the file to open relative to the directory specified by "location"

  • location

    One of "script" or "data"

  • offset

    The zero-based offset at which to begin reading

  • length

    The number of bytes to read. If < 0, the entire file after "offset" is read.

  • data

    The variable in which to store the file data

Return Values

Examples

This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

Accept

Copyright © 1997 – 2019 Miva©, Miva Merchant©, MivaPay©, MivaCon© Miva, Inc. All Rights Reserved.