Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

NSFileManagerMBS.NSFileTypeSocket as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Notes: Socket (a socket visible in file system as a file)

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileTypeSymbolicLink as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Notes: Symbolic link

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileTypeUnknown as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Notes: Unknown

Feedback, Comments & Corrections

NSFileManagerMBS.NSUbiquityIdentityDidChangeNotification as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 18.5 Yes No No Yes, macOS only No
Function: Sent after the iCloud (“ubiquity”) identity has changed.
Notes:
The system generates this notification when the user logs into or out of an iCloud account or enables or disables the syncing of documents and data. This notification is your cue to update caches and any interface elements displaying iCloud–related content. For example, hide all references to iCloud files when the user logs out of iCloud.
When your app receives this notification, get the new token from the NSURLRelationship property. The value of that token is nil if the user disabled iCloud or logged out. There is no userInfo dictionary.

Feedback, Comments & Corrections

NSFileManagerMBS.pathExtension(pathOrURL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns the path extension of a file URL or file path.
Notes: Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.stringByAbbreviatingWithTildeInPath(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string that replaces the current home directory portion of the current path with a tilde (~) character.
Notes:
A new string based on the current string object. If the new string specifies a file in the current home directory, the home directory portion of the path is replaced with a tilde (~) character. If the string does not specify a file in the current home directory, this method returns a new string object whose path is unchanged from the path in the current string.

Note that this method only works with file paths. It does not work for string representations of URLs.

For sandboxed apps in OS X, the current home directory is not the same as the user’s home directory. For a sandboxed app, the home directory is the app’s home directory. So if you specified a path of /Users/<current_user>/file.txt for a sandboxed app, the returned path would be unchanged from the original. However, if you specified the same path for an app not in a sandbox, this method would replace the /Users/<current_user> portion of the path with a tilde.

Feedback, Comments & Corrections

NSFileManagerMBS.stringByAppendingPathComponent(path as string, Component as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by appending to the receiver a given string.
Notes:
The following table illustrates the effect of this method on a variety of different paths, assuming that aString is supplied as “scratch.tiff”:

Receiver’s String ValueResulting String
“/tmp”“/tmp/scratch.tiff”
“/tmp/”“/tmp/scratch.tiff”
“/”“/scratch.tiff”
“” (an empty string)“scratch.tiff”

Note that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByAppendingPathExtension(path as string, Extension as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by appending to the receiver an extension separator followed by a given extension.
Notes:
The following table illustrates the effect of this method on a variety of different paths, assuming that ext is supplied as "tiff":

Receiver’s String ValueResulting String
“/tmp/scratch.old”“/tmp/scratch.old.tiff”
“/tmp/scratch.”“/tmp/scratch..tiff”
“/tmp/”“/tmp.tiff”
“scratch”“scratch.tiff”

Note that adding an extension to "/tmp/" causes the result to be "/tmp.tiff" instead of "/tmp/.tiff". This difference is because a file named ".tiff" is not considered to have an extension, so the string is appended to the last nonempty path component.

Note that this method only works with file paths (not, for example, string representations of URLs).

Special Considerations
Prior to OS X v10.9 this method did not allow you to append file extensions to filenames starting with the tilde character (~).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByDeletingLastPathComponent(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by deleting the last path component from the receiver, along with any final path separator.
Notes:
A new string made by deleting the last path component from the receiver, along with any final path separator. If the receiver represents the root path it is returned unaltered.

The following table illustrates the effect of this method on a variety of different paths:

Receiver’s String ValueResulting String
“/tmp/scratch.tiff”“/tmp”
“/tmp/lock/”“/tmp”
“/tmp/”“/”
“/tmp”“/”
“/”“/”
“scratch.tiff”“” (an empty string)

Note that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByDeletingPathExtension(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by deleting the extension (if any, and only the last) from the receiver.
Notes:
A new string made by deleting the extension (if any, and only the last) from the receiver. Strips any trailing path separator before checking for an extension. If the receiver represents the root path, it is returned unaltered.

The following table illustrates the effect of this method on a variety of different paths:

Receiver’s String ValueResulting String
“/tmp/scratch.tiff”“/tmp/scratch”
“/tmp/”“/tmp”
“scratch.bundle/”“scratch”
“scratch..tiff”“scratch.”
“.tiff”“.tiff”
“/”“/”

Note that attempting to delete an extension from ".tiff" causes the result to be @".tiff" instead of an empty string. This difference is because a file named ".tiff" is not considered to have an extension, so nothing is deleted. Note also that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByExpandingTildeInPath(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by expanding the initial component of the receiver to its full path value.
Notes:
A new string made by expanding the initial component of the receiver, if it begins with “~” or “~user”, to its full path value. Returns a new string matching the receiver if the receiver’s initial component can’t be expanded.

Note that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByResolvingSymlinksInPath(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made from the receiver by resolving all symbolic links and standardizing path.
Notes:
A new string made by resolving all symbolic links, then removing extraneous path components. For absolute paths, all symbolic links are guaranteed to be removed. For relative paths, symbolic links that can’t be resolved are left unresolved in the returned string.

Returns self if an error occurs.

Note that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.stringByStandardizingPath(path as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 16.4 Yes No No Yes, macOS only No
Function: Returns a new string made by removing extraneous path components from the receiver.
Notes:
A new string made by performing the following operations:

  • Expanding an initial tilde expression using stringByExpandingTildeInPath.
  • Removing an initial component of “/private/var/automount”, “/var/automount”, or “/private” from the path, if the result still indicates an existing file or directory (checked by consulting the file system).
  • Reducing empty components and references to the current directory (that is, the sequences “//” and “/./”) to single path separators.
  • Removing a trailing slash from the last component.
  • For absolute paths only, resolving references to the parent directory (that is, the component “..”) to the real parent directory if possible using stringByResolvingSymlinksInPath. For relative paths, references to the parent directory are left in place.
  • Returns self if an error occurs.

Note that the path returned by this method may still have symbolic link components in it. Note also that this method only works with file paths (not, for example, string representations of URLs).

Feedback, Comments & Corrections

NSFileManagerMBS.URLByAppendingPathComponent(URL as string, pathComponent as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL made by appending a path component to the original URL.
Notes:
pathComponent: The path component to add to the URL.

Returns a new URL with pathComponent appended.

If the original URL does not end with a forward slash and pathComponent does not begin with a forward slash, a forward slash is inserted between the two parts of the returned URL, unless the original URL is the empty string.

Available in Mac OS X v10.6 and later.

See also:

Feedback, Comments & Corrections

NSFileManagerMBS.URLByAppendingPathComponent(URL as string, pathComponent as string, isDirectory as boolean) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL made by appending a path component to the original URL, along with a trailing slash if the component is designated a directory.
Notes:
pathComponent: The path component to add to the URL.
isDirectory: If true, a trailing slash is appended after pathComponent.
Returns a new URL with pathComponent appended.

If the original URL does not end with a forward slash and pathComponent does not begin with a forward slash, a forward slash is inserted between the two parts of the returned URL, unless the original URL is the empty string.

Available in Mac OS X v10.7 and later.

See also:

Feedback, Comments & Corrections

NSFileManagerMBS.URLByAppendingPathExtension(URL as string, pathExtension as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL made by appending a path extension to the original URL.
Notes:
pathExtension: The path extension to add to the URL.

Returns a new URL with pathExtension appended.

If the original URL ends with one or more forward slashes, these are removed from the returned URL. A period is inserted between the two parts of the new URL.
Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.URLByDeletingLastPathComponent(URL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL made by deleting the last path component from the original URL.
Notes:
If the original URL represents the root path, the returned URL is identical. Otherwise, if the original URL has only one path component, the new URL is the empty string.
Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.URLByDeletingPathExtension(URL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL made by deleting the path extension, if any, from the original URL.
Notes:
If the original URL represents the root path, the returned URL is identical. If the URL has multiple path extensions, only the last one is removed.
Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.URLByResolvingSymlinksInPath(URL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL that points to the same resource as the original URL and includes no symbolic links.
Notes:
If the original URL has no symbolic links, the returned URL is identical to the original URL.

This method only works on URLs with the file: path scheme. This method will return an identical URL for all other URLs.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.URLByStandardizingPath(URL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns a new URL that points to the same resource as the original URL and is an absolute path.
Notes:
This method only works on URLs with the file: path scheme. This method will return an identical URL for all other URLs.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

Previous items

The items on this page are in the following plugins: MBS MacCocoa Plugin.




Links
MBS FileMaker tutorial videos