Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
determine file path of shared folder
#1
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?
#2
Function GetQmSharedFolderFilePath
Code:
Copy      Help
;/
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
Code:
Copy      Help
;paths of all loaded files; the first is the main file
ARRAY(str) a
_qmfile.GetLoadedFiles(a)
out a
#3
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)