Platforms to show: All Mac Windows Linux Cross-Platform

Back to FolderItem class.

FolderItem.SetFileFlagsMBS(flags as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS MacClassic Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Set the file flags for the folderitem to the given value. Returns 0 if okay.
Example
dim f as FolderItem
dim err, fdFlags as Integer

// For example, clearing a file's hasCustomIcon flag works like this:
fdFlags = f.GetFileFlagsMBS
if fdFlags >= 0 then
err = f.SetFileFlagsMBS(BitExclMBS(fdFlags, 10))
if err <> 0 then
// ... oops, an error occured
// (for instance, the disk could be write protected)
end
end

Sets the fdFlags of a file. Returns an error code (or zero if no error occured). Possible error conditions include "disk is write protected" and "file not found".
When changing flags of a file, use GetFileFlags to get the original flags, then clear or set the flags by using BitwiseAnd and BitwiseOr and call SetFileFlags to set the new flags.

Some examples using this method:

Blog Entries

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


The biggest plugin in space...