matevfs Functions Additional functions which are not part of a class.

## Synopsis

            matevfs.create
    	uri
    	open_modematevfs.OPEN_NONE
    	exclusiveFalse
    	perm0666

            matevfs.get_file_info
    	uri
    	optionsmatevfs.FILE_INFO_DEFAULT

            matevfs.set_file_info
    	uri
    	info
    	maskmatevfs.SET_FILE_INFO_NONE

            matevfs.truncate
    	uri
    	length

            matevfs.make_directory
    	uri
    	perm

            matevfs.remove_directory
    	uri

            matevfs.unlink
    	uri

            matevfs.exists
    	uri

            matevfs.format_file_size_for_display
    	size

            matevfs.get_mime_type
    	uri

            matevfs.get_mime_type_for_data
    	data

            matevfs.mime_get_icon
    	mime_type

            matevfs.mime_set_icon

            matevfs.mime_get_description
    	mime_type

            matevfs.mime_set_description

            matevfs.mime_can_be_executable
    	mime_type

            matevfs.mime_set_can_be_executable

            matevfs.monitor_add
    	text_uri
    	monitor_type
    	callback
    	user_dataNone

            matevfs.monitor_cancel
    	id

            matevfs.read_entire_file
    	text_uri

            matevfs.mime_get_default_application
    	mime_type

            matevfs.xfer_uri

            matevfs.xfer_uri_list

            matevfs.xfer_delete_list

            matevfs.mime_get_default_action_type

            matevfs.mime_get_default_action

            matevfs.mime_get_default_component

            matevfs.mime_get_short_list_components

            matevfs.mime_get_short_list_applications

            matevfs.mime_get_all_applications

            matevfs.mime_get_all_components

            matevfs.mime_set_default_action_type

            matevfs.mime_set_default_application

            matevfs.mime_set_default_component

            matevfs.mime_set_short_list_applications

            matevfs.mime_set_short_list_components

            matevfs.mime_add_application_to_short_list

            matevfs.mime_remove_application_from_short_list

            matevfs.mime_add_component_to_short_list

            matevfs.mime_remove_component_from_short_list

            matevfs.mime_add_extension

            matevfs.mime_remove_extension

            matevfs.mime_extend_all_applications

            matevfs.mime_remove_from_all_applications

            matevfs.mime_application_new_from_id

            matevfs.connect_to_server

            matevfs.escape_string

            matevfs.escape_path_string

            matevfs.escape_host_and_path_string

            matevfs.escape_slashes

            matevfs.escape_set

            matevfs.unescape_string

            matevfs.make_uri_canonical

            matevfs.make_path_name_canonical

            matevfs.unescape_string_for_display

            matevfs.get_local_path_from_uri

            matevfs.get_uri_from_local_path

            matevfs.is_executable_command_string

            matevfs.get_volume_free_space

            matevfs.icon_path_from_filename

            matevfs.open_fd

            matevfs.is_primary_thread

            matevfs.format_uri_for_display

            matevfs.make_uri_from_input

            matevfs.make_uri_from_input_with_dirs

            matevfs.make_uri_canonical_strip_fragment

            matevfs.uris_match

            matevfs.get_uri_scheme

            matevfs.make_uri_from_shell_arg

            matevfs.url_show

            matevfs.resolve

            matevfs.dns_sd_browse_sync

            matevfs.dns_sd_resolve_sync

            matevfs.dns_sd_list_browse_domains_sync

            matevfs.get_default_browse_domains

## Description

These functions are part of the matevfs module but are not associated with a specific class.

## Functions

### matevfs.create

    	  matevfs.create
    	  uri
    	  open_modematevfs.OPEN_NONE
    	  exclusiveFalse
    	  perm0666

uri:

  The URI to create.

open_mode:

  Mode to leave the file in after creation (or matevfs.OPEN_MODE_NONE to leave the file closed).

exclusive:

  Whether the file should be created in "exclusive" mode. i.e. if this flag is nonzero, The operation will fail if a file with the same name already exists.

perm:

  Or'd set of file permissions flags

Returns:

  A matevfs.Handle.

Create and open uri according to open_mode.

### matevfs.get_file_info

    	  matevfs.get_file_info
    	  uri
    	  optionsmatevfs.FILE_INFO_DEFAULT

uri:

  The URI to retrieve information for.

options:

  Or'd set of file info options.

Returns:

  A matevfs.FileInfo

Retrieve information about uri.

### matevfs.set_file_info

              matevfs.set_file_info
    	  uri
    	  info
    	  maskmatevfs.SET_FILE_INFO_NONE

uri:

  The URI to set information on.

info:

  matevfs.FileInfo with the information to set.

mask:

  Or'd set of file info set flags.

Set file information for uri. Only the information for which the corresponding bit in mask is set is actually modified.

### matevfs.truncate

              matevfs.truncate
    	  uri
    	  length

uri:

  The URI of the file to truncate.

length:

  The length to truncate to.

Truncate a file to a specific length.

### matevfs.make_directory

    	  matevfs.make_directory
    	  uri
    	  perm

uri:

  The URI of the directory to create.

perm:

  Or'd set of file permissions flags.

Create a directory with the given name and permissions.

### matevfs.remove_directory

    	  matevfs.remove_directory
    	  uri

uri:

  The URI of the directory to remove.

Remove a directory.

### matevfs.unlink

    	  matevfs.unlink
    	  uri

uri:

  The URI of the file to unlink

Unlink (delete) a URI.

### matevfs.exists

    	  matevfs.exists
    	  uri

uri:

  The URI to check.

Returns:

  True if the URI exists.

Check if a given URI exists.

### matevfs.format_file_size_for_display

    	  matevfs.format_file_size_for_display
    	  size

size:

  The size of the file in bytes

Returns:

  A string with the printable size

Formats size in a way that is easy for the user to read. Gives the size in bytes, kilobytes, megabytes or gigabytes, choosing whatever is appropriate.

### matevfs.get_mime_type

    	  matevfs.get_mime_type
    	  uri

uri:

  The URI to retrieve the mime type for.

Returns:

  A string containing the mime type.

Determine the mime type of uri. The mime type is determined in the same way as by matevfs.get_file_info.

### matevfs.get_mime_type_for_data

data:

  A string containing the data.

Returns:

  A string containing the mime type.

Tries to guess the mime type of the data in data using magic patterns.

### matevfs.mime_get_icon

    	  matevfs.mime_get_icon
    	  mime_type

mime_type:

  A string with the mime type.

Returns:

  A string with an icon name.

Query the MIME database for an icon representing mime_type. It usually returns a filename without path information, e.g. "i-chardev.png", and sometimes does not have an extension, e.g. "i-regular" if the icon is supposed to be image type agnostic between icon themes. Icons are generic and not theme specific. These will not necessarily match with the icons a user sees in Caja, you have been warned.

### matevfs.mime_get_description

    	  matevfs.mime_get_description
    	  mime_type

mime_type:

  The mime type to query.

Returns:

  A description of the mime type.

Query the MIME database for a description of mime_type.

### matevfs.mime_can_be_executable

    	  matevfs.mime_can_be_executable
    	  mime_type

mime_type:

  The mime type to query.

Returns:

  True if files of mime_type can be executable, False otherwise.

Check whether files of mime_type might conceivably be executable. Default for known types is False. Default for unknown types is True.

### matevfs.monitor_add

    	  matevfs.monitor_add
    	  text_uri
    	  monitor_type
    	  callback
    	  extraNone

text_uri:

  String representing the URI to monitor.

monitor_type:

  A monitor type signifying the type of the URI.

callback:

  Function to call when the monitor is tripped.

user_data:

  Data to pass to callback

Returns:

  An identifier representing this monitor.

Watch the file or directory at text_uri for changes (or the creation/deletion of the file) and call callback when there is a change. If a directory monitor is added, callback is notified when any file in the directory changes.

### matevfs.monitor_cancel

    	  matevfs.monitor_cancel
    	  id

id:

  Identifier which was given by monitor_add

Cancel the monitor pointed to by id

### matevfs.read_entire_file

    	  matevfs.read_entire_file
    	  text_uri

text_uri:

  String containing the URI of the file to read.

Returns:

  String containing the data in the file.

Reads an entire file into memory for convenience. Beware of accidentally loading large files into memory with this function.

### matevfs.mime_get_default_application

    	  matevfs.mime_get_default_application
    	  mime_type

mime_type:

  Mime type to query.

Returns:

  Information about the application configured as the default handler for mime_type.

Query the MIME database for the default MateComponent component to be activated to view files of MIME type mime_type