JackhBSC Posted August 18, 2009 Share Posted August 18, 2009 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. Help! Quote Link to comment
MullinRJ Posted August 18, 2009 Share Posted August 18, 2009 Hi Jack, ???Have you tried GetFileInfo()? It was introduced in v12. From the VSFR: 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 ) ; Raymond Quote Link to comment
JackhBSC Posted August 19, 2009 Author Share Posted August 19, 2009 Raymond, 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! Quote Link to comment
MullinRJ Posted August 19, 2009 Share Posted August 19, 2009 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. Raymond PROCEDURE xxx; CONST ??????CR = chr(13);??????{ Carriage Return } VAR ??????dateValue, filename, fullReadPath, fullWritePath :String; ??????readFileExists, writeFileExists, locked, hasReadPermission, hasWritePermission, hasFolderPermission :Boolean; ??????vMaj, vMin, vMai, vPlat :Integer; BEGIN ??????dateValue := Date(1, 0);??????{ Abbreviated Date, Date Only } ??????GetFile(filename); ??????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)); END; Run(xxx); Quote Link to comment
MullinRJ Posted August 19, 2009 Share Posted August 19, 2009 This is what you want to use. filename := GetFPathName;??????{ poorly documented function } There is some info on this function here: http://developer.vectorworks.net/index.php?title=VS:GetFPathName HTH, Raymond Quote Link to comment
JackhBSC Posted August 19, 2009 Author Share Posted August 19, 2009 Fantastic! GetFPathName worked a treat! Thank you so much! Jack Quote Link to comment
_c_ Posted August 26, 2009 Share Posted August 26, 2009 Raymond, no. GetFPathName is rather faulty on Mac and cannot be recommended. Please see the notes in: Charles' VSFR then search for GetFPathName It also returns posix path on VW13 and path with colons on VW14. orso Quote Link to comment
MullinRJ Posted August 26, 2009 Share Posted August 26, 2009 orso, 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. Raymond Quote Link to comment
_c_ Posted August 26, 2009 Share Posted August 26, 2009 (edited) 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? PS 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 August 26, 2009 by _c_ Quote Link to comment
Recommended Posts
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.