Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
glob_resource(3)		 Arcan Lua API		      glob_resource(3)

NAME
       glob_resource  -	Search the different datastores	for resources matching
       a pattern.

SYNOPSIS
       strtbl
       glob_resource( string:pattern )
       glob_resource( string:pattern, int:domain )
       glob_resource( string:pattern, string:namespace )

DESCRIPTION
       There are a number of different statically defined namespaces (distinct
       group  where  a	certain	 resource key corresponds to a file or similar
       data-source). This function allows you to query parts  of  these	 name-
       spaces  (indicated by a search path, pattern ). By specifying a domain
       you can limit the search	to a specific set of namespaces.  This	domain
       can  be a predefined bitmap of numeric constants, or a user-defined dy-
       namic namespace tag. Valid constants for	domain	(can  be  OR  ed)  are
       APPL_RESOURCE  ,	 APPL_TEMP_RESOURCE  ,	SHARED_RESOURCE	, SYS_APPL_RE-
       SOURCE ,	SYS_FONT_RESOURCE , APPL_STATE_RESOURCE	,

NOTES
       1      the default domain is the	compile-time defined  (	 DEFAULT_USER-
	      MASK ) which is comprised	of (application- specific, application
	      shared, application temporary)

       2      The results contain only filename	and, possibly, extension.

       3      The scan is shallow, it will not	recurse	 into  subdirectories.
	      Therefore, more complex patterns,	e.g. /*/a* will	not work.

       4

	      SYS_APPL_RESOURCE	  is special and relates to the	list of	appli-
	      cation targets that can be used as argument to system_collapse.

EXAMPLE
       function	glob_resource0()
	     local tbl = glob_resource("*");
	     for i,v in	ipairs(tbl) do
		   print(v);
	     end
       end

EXAMPLE
       function	glob_resource1()
	     local tbl = glob_resource("*", SYS_APPL_RESOURCE);
	     for i,v in	ipairs(tbl) do
		   print(v);
	     end
       end

MISUSE
       function	glob_resource0()
	     local tbl = glob_resource(0);
	     if	(type(tbl) ~= "table") then
		   abort();
	     end
       end

SEE ALSO:
       resource(3) system_collapse(3)

resource			  April	2022		      glob_resource(3)

NAME | SYNOPSIS | DESCRIPTION | NOTES | EXAMPLE | EXAMPLE | MISUSE | SEE ALSO:

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=glob_resource&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help