Garry's Mod Wiki

File:Read

string File:Read( number length )

Description

Reads the specified amount of chars and returns them as a binary string.

Arguments

1 number length
Reads the specified amount of chars.

Returns

1 string data

Example

Adapted from extensions/file.lua

function file.Read( filename, path ) if ( path == true ) then path = "GAME" end if ( path == nil || path == false ) then path = "DATA" end local f = file.Open( filename, "rb", path ) if ( !f ) then return end local str = f:Read( f:Size() ) f:Close() if ( !str ) then str = "" end return str end

Page Links


Special Pages


Wikis

?

Render Time: 32ms

Session 0
DB GetPage 4
Generate Html 6
SaveChanges 10
Render Body 0
Render Sidebar 10