VS:GetFileInfo

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix


Description

This function gets the attributes of a file.
PROCEDURE GetFileInfo(
filename  :STRING;
VAR fullReadPath  :STRING;
VAR fullWritePath  :STRING;
VAR readFileExists  :BOOLEAN;
VAR writeFileExists  :BOOLEAN;
VAR locked  :BOOLEAN;
VAR hasReadPermission  :BOOLEAN;
VAR hasWritePermission  :BOOLEAN;
VAR hasFolderPermission  :BOOLEAN);
def vs.GetFileInfo(filename):
    return (fullReadPath, fullWritePath, readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission)

Parameters

filename STRING
fullReadPath STRING
fullWritePath STRING
readFileExists BOOLEAN
writeFileExists BOOLEAN
locked BOOLEAN
hasReadPermission BOOLEAN
hasWritePermission BOOLEAN
hasFolderPermission BOOLEAN

Example

VectorScript

PROCEDURE Example;
VAR
fileName :STRING;
fullReadPath, fullWritePath :STRING;
readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission :BOOLEAN;
BEGIN
fileName := Concat(GetFolderPath(1), 'ADINIT.DAT');
GetFileInfo(fileName, fullReadPath, fullWritePath, readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission);
ReWrite('Output.txt');
WriteLn('fileName:            ', fileName);
WriteLn('fullReadPath:        ', fullReadPath);
WriteLn('fullWritePath:       ', fullWritePath);
WriteLn('readFileExists:      ', readFileExists);
WriteLn('writeFileExists:     ', writeFileExists);
WriteLn('locked:              ', locked);
WriteLn('hasReadPermission:   ', hasReadPermission);
WriteLn('hasWritePermission:  ', hasWritePermission);
WriteLn('hasFolderPermission: ', hasFolderPermission);
Close('Output.txt');
END;
RUN(Example);

Python


Version

Availability: from VectorWorks12.0
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox