Difference between revisions of "love.filesystem.getRequirePath"

(Created page)
 
m
 
Line 13: Line 13:
 
None.
 
None.
 
=== Returns ===
 
=== Returns ===
{{param|string|paths|The paths that the ''require'' function will check in love's filesystem. The default paths string is <code>"?.lua;?/init.lua"</code>, which makes <code>require("cool")</code> try to load <code>cool.lua</code> and then try <code>cool/init.lua</code> if cool.lua doesn't exist.}}
+
{{param|string|paths|The paths that the ''require'' function will check in love's filesystem.}}
 +
 
 +
== Notes ==
 +
The default paths string is <code>"?.lua;?/init.lua"</code>, which makes <code>require("cool")</code> try to load <code>cool.lua</code> and then try <code>cool/init.lua</code> if cool.lua doesn't exist.
  
 
== See Also ==
 
== See Also ==

Latest revision as of 04:35, 5 December 2015

Available since LÖVE 0.10.0
This function is not supported in earlier versions.

Gets the filesystem paths that will be searched when require is called.

The paths string returned by this function is a sequence of path templates separated by semicolons. The argument passed to require will be inserted in place of any question mark ("?") character in each template (after the dot characters in the argument passed to require are replaced by directory separators.)

The paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.

Function

Synopsis

paths = love.filesystem.getRequirePath( )

Arguments

None.

Returns

string paths
The paths that the require function will check in love's filesystem.

Notes

The default paths string is "?.lua;?/init.lua", which makes require("cool") try to load cool.lua and then try cool/init.lua if cool.lua doesn't exist.

See Also

Other Languages