Posts: 21
Threads: 8
Joined: Apr 2007
Is there a function to return the file path of a shared folder? I can see it when I hover over the folder, but is there a way to return that path, so I can make sure the right path was used for the file which was added as a shared folder?
Posts: 12,072
Threads: 140
Joined: Dec 2002
Function
GetQmSharedFolderFilePath
;/
function! $sharedFolder str&filePath
;Gets QM shared folder file path.
;Returns: 1 success, 0 failed.
;sharedFolder - shared folder path (like "\System"), or GUID (like "{ACBAA175-3536-4603-9C7D-BF35F590075A}") or QM item id (like +iid).
;filePath - this variable receives file path of the shared folder.
;EXAMPLE
;str s
;if(!GetQmSharedFolderFilePath("\System" s)) end "failed"
;out s
int rowid; _qmfile.SqliteItemProp(sharedFolder rowid)
Sqlite& x=_qmfile.SqliteBegin
SqliteStatement k.Prepare(x F"SELECT td FROM items WHERE id={rowid}")
if(!k.FetchRow) ret
lpstr s=k.GetBlob(0 &_i); if(_i<5) ret
_qmfile.SqliteEnd
s+4
if(findc(s '\')<0) filePath.from(_qmdir s); else filePath=s; filePath.expandpath
ret 1
err+
Macro
Macro2181
;paths of all loaded files; the first is the main file
ARRAY(str) a
_qmfile.GetLoadedFiles(a)
out a
Posts: 21
Threads: 8
Joined: Apr 2007
Thanks. Function GetQmSharedFolderFilePath works. But _qmfile.GetLoadedFiles doesn't work for what I need because it only shows shared files that are not set to "Load local read-only copy". Under normal circumstances, that *is* how I want my users to access the shared folder, and I need to have the function still work. So the first one works for me. Thanks.