FileIOPermission – PB Docs 120


FileIOPermission

FileIOPermission settings are required for PowerScript system functions in Windows Forms targets.

Permission requirements in Web Forms

For Web Forms targets, file-releated functions require Read, Write, Append and PathDiscovery permissions on the
appname_root
directory. For print-related functions, you must set the PrintingPermission value to AllPrinting, in addition to setting Read, Write, and PathDiscover permissions on the
appname_root/print
directory.

Permission requirements for Windows Forms

FileIOPermission required for system functions in Windows Forms
System function Permission required
AddToLibraryList,DirectoryExists , FileEncoding, FileExists, FileLength, FileLength64, FileRead, FileReadEx, FileSeek, FileSeek64, LibraryDirectory, LibraryDirectoryEx, LibraryExport, PrintBitmap, ProfileInt, ProfileString, SetProfileString, SetLibraryList, ShowHelp, ShowPopupHelp, and XMLParseFile Read
FileWrite, FileWriteEx, RemoveDirectory, LibraryCreate, LibraryDelete, and LibraryImport Write
FileDelete Read and Write
FileOpen When the FileAccess argument is Read!

  • Read permission for file named in FileName (first) argument

When the FileAccess argument is Write!

  • Append and Write permission when the WriteMode argument is Append!
  • Read and Write permission when the WriteMode argument is Replace!
FileCopy (string s, string t) Read for the source file (first) argument; Write for the target file (second) argument
FileMove (string s, string t) Read and Write for the source file (first) argument; Write for the target file (second) argument
GetFolder Unrestricted
GetCurrentDirectory PathDiscovery for the current directory
CreateDirectory (string d) Read for the parent directory; Write for the directory name argument
This table shows the required FileIOPermission settings for object and control functions in Windows Forms targets.

Object or control Function or property Permission required
Animation AnimationName Read
DataWindow SaveAsAscii , SaveAsFormattedText , SavInk , SaveInkPicture Write
ImportFile Read permission if the (usually second) file name argument is supplied; if file name argument is empty or null, requires OpenSave FileDialogPermission and Unrestricted FileIOPermission
SaveAs
Write permission if the (usually second) file name argument is supplied; if file name argument is empty or null, requires OpenSave FileDialogPermission and Unrestricted FileIOPermission
DataWindow (RichText only) InsertDocument Read
DataStore ImportFile Read
SaveAs, SaveAsAscii , SaveAsFormattedText , SavInk , SaveInkPicture Write
DragObject

DragIcon property Read
DropDownListBox, ListBox DirList (string s, uint filetype) Read and PathDiscovery for the file specification (first) argument
DropDownPictureListBox, PictureListBox

AddPicture, and PictureName property Read
DirList (string s, uint filetype) Read and PathDiscovery for the file specification (first) argument
Graph ImportFile Read
SaveAs Unrestricted for function with no arguments; Write on the file name (first) argument for function with arguments
InkPicture PictureFileName property Read
LoadInk Read and Write for the file (first) argument
LoadPicture Read for the file (first) argument
Save, SaveInk Write for the file (first) argument and for the current temporary file directory
Listview AddLargePicture, AddSmallPicture, AddStatePicture, and LargePictureName, SmallPictureName, StatePictureName properties Read
Picture PictureName property Read
PictureButton DisabledName, PictureName properties Read
RichTextEdit InsertDocument, InsertPicture Read
SaveDocument Write
Treeview AddPicture, AddStatePicture, and PictureName, StatePictureName properties Read
UserObject PictureName property Read

Example 1

This XML example gives Read access to two files and write access to one of those files:

Example 2

This example for a Web Forms application grants Read, Write, Append, and PathDiscovery permissions to the main deployment and root directories for the MyWebApp application:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x