/ Published in: Revolution
URL: http://tech.groups.yahoo.com/group/revInterop/
This is part of the Revolution Standard Library.
Expand |
Embed | Plain Text
function stdFileInfo pFilePath,pOpt_InfoItem if pOpt_InfoItem "" then if pOpt_InfoItem is not among the items of "full,fileName,dataSize,resSize,createDate,modDate,accessDate,BUdate,ownerID,groupID,permissions,creatorType,size,creator,type,array" then return "StdLibError: '" & pOpt_InfoItem & "' is not a valid file property." end if end if set the itemDel to "/" put urlEncode(last item of pFilePath) into tItem delete last item of pFilePath put the directory into tOldDir set the directory to pFilePath put the detailed files into tDetailedList set the directory to tOldDir set the itemDel to "," put lineOffset(cr&tItem&",",cr&tDetailedList) into tLine put line tLine of tDetailedList into tDetailedInfo if pOpt_InfoItem = "" then return tDetailedInfo replace "," with tab in tDetailedInfo set the itemDel to tab put tDetailedInfo into tFileA["full"] put urlDecode(item 1 of tDetailedInfo) into tFileA["fileName"] put (item 2 of tDetailedInfo) into tFileA["dataSize"] put (item 3 of tDetailedInfo) into tFileA["resSize"] put (item 2 of tDetailedInfo) + (item 3 of tDetailedInfo) into tFileA["size"] put "createDate,modDate,accessDate,BUdate" into tDates replace "," with tab in tDates repeat with x = 4 to 7 put item x of tDetailedInfo into tSecs if tSecs "" then convert tSecs to short date and time put tSecs into tFileA[(item x-3 of tDates)] end repeat put (item 8 of tDetailedInfo) into tFileA["ownerID"] put (item 9 of tDetailedInfo) into tFileA["groupID"] put (item 10 of tDetailedInfo) into tFileA["permissions"] put (item 11 of tDetailedInfo) into tFileA["creatorType"] put (char 1 to 4 of item 11 of tDetailedInfo) into tFileA["creator"] put (char 5 to 8 of item 11 of tDetailedInfo) into tFileA["type"] if pOpt_InfoItem = "array" then return tFileA else return tFileA[pOpt_InfoItem] end if end stdFileInfo
You need to login to post a comment.
