Jump to content
Sign in to follow this  

How to get the file path name

Recommended Posts

To anyone who might know this i am building a data stamp and i want to get the full file path for the active document. I can get the file name (GetFName) and i can get the file path of the application (GetFolderPath (1)) but i can't seem to get the full file path name.


Share this post

Link to post

Hi Jack,

???Have you tried GetFileInfo()? It was introduced in v12.

From the VSFR:


(???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

) ;


Share this post

Link to post


yeah, I saw that but for some reason i am having trouble getting it to work.

Currently i have within the script:

dateValue := Date(dateFormat, infoFormat);

docName := GetFileInfo (filename : GetFName ; FullWritePath);

GetVersion(vMaj, vMin, vMai, vPlat);

But i have tried all sorts without much success

My knowledge on this is limited son any help very much apreciated!

Share this post

Link to post

Hi Jack,

???This won't do exactly what you want, but it will compile, it will run and it will show the values it collects.




??????CR = chr(13);??????{ Carriage Return }


??????dateValue, filename, fullReadPath, fullWritePath :String;

??????readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission :Boolean;

??????vMaj, vMin, vMai, vPlat :Integer;


??????dateValue := Date(1, 0);??????{ Abbreviated Date, Date Only }


??????GetFileInfo(filename, fullReadPath, fullWritePath,

????????????????????????readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission);

??????GetVersion(vMaj, vMin, vMai, vPlat);

??????AlrtDialog(concat(dateValue, CR, 'Major = ', vMaj, ' Minor = ', vMin, ' Maintenance = ', vMai, ' Platform = ', vPlat));

??????AlrtDialog(concat(filename, CR, fullReadPath, CR, fullWritePath, CR, readFileExists, ' ', writeFileExists, ' ', locked, ' ', hasReadPermission, ' ', hasWritePermission, ' ', hasFolderPermission));



Share this post

Link to post


Though all you say is true, knowing these shortcomings, one can program around the problems, or avoid them altogether. Even partially impaired, the function works for a majority of cases. For my own uses, the function works quite well enough and I would not avoid using it. I don't think any of the problems are critical enough to not recommend it. Just use it with caution - Caveat Scriptor.


Share this post

Link to post

Yes, I have stopped using it because of the diacriticals, a concrete problem in Germany. But the 28 chars limit is actually worse.

To be grim no end, also GetFileInfo is quirky enough. We were discussing this together with Conrad P. There are different behavior between versions in the returned read path. And across platform.

So Raymond, indeed all this is only a trouble for paranoids, people who needs to develop across versions and across platforms and operates on resources and file paths.

Who do you know? :)

ciao, R?


Actually GetFPathName is the only bridge to the "saved status" of a file, at least the only secure. But win only.

There is up to VW14 no *completely* secure way to establish if a file has been saved already or not on Mac up to VW14, because of the bugs in GetFPathName.

Edited by orso b. schmid

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...