the detailed files

Ken Ray kray at sonsothunder.com
Wed Jul 31 10:31:00 EDT 2002


To add to Richard's code, if you want to be able to retrieve all the
attributes, you can use the handy (if long) matchText function. Here's an
example using matchText with a modified version of Richard's code:

on mouseUp
  local
tFileName,tDataSize,tResSize,tModDate,tAccessDate,tBackupDate,tUserID,tGroup
ID,tFilePermissions,tTypeCreator
  answer file "Select a file:"
  put FileInfo(it) into tFileInfo
  get
matchText(tFileInfo,"(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(
.*?)",tFileName,tDataSize,tResSize,tModDate,tAccessDate,tBackupDate,tUserID,
tGroupID,tFilePermissions,tTypeCreator)

 -- do what you want with the data that is now in the local vars
 -- Examples:
 answer "The file name is: " & urlDecode(tFileName)
 answer "The last modification date is: " & tModDate
end mouseUp

function FileInfo pPath
  local tFile, tSaveDir, tFiles, tFileInfo
  set the itemdel to "/"
  put urlEncode(last item of pPath) into tFile
  delete last item of pPath
  put the directory into tSaveDir
  set the directory to pPath
  put the detailed files into tFiles
  set the directory to tSaveDir
  get lineoffset(tFile, tFiles)
  if it > 0 then
    return line it of tFiles
  end if
end FileInfo


Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



----- Original Message -----
From: "Richard Gaskin" <ambassador at fourthworld.com>
To: <metacard at lists.runrev.com>
Sent: Wednesday, July 31, 2002 2:30 AM
Subject: Re: the detailed files


> Simon Lord wrote:
>
> > Is it possible to get the detailed files of a particular file
> > only?  How?
>
> Nothing built-in, but this FileInfo function might help:
>
>
> on mouseUp
>   answer file "Select a file:"
>   put FileInfo(it)
> end mouseUp
>
>
> function FileInfo pPath
>   local tFile, tSaveDir, tFiles, tFileInfo
>   set the itemdel to "/"
>   put urlEncode(last item of pPath) into tFile
>   delete last item of pPath
>   put the directory into tSaveDir
>   set the directory to pPath
>   put the detailed files into tFiles
>   set the directory to tSaveDir
>   get lineoffset(tFile, tFiles)
>   if it > 0 then
>     put line it of tFiles into tFileInfo
>     set the itemdel to ","
>     delete item 1 of tFileInfo
>     return tFileInfo
>   end if
> end FileInfo
>
>
>
>
> --
>  Richard Gaskin
>  Fourth World Media Corporation
>  Custom Software and Web Development for All Major Platforms
>  Developer of WebMerge 2.0: Publish any Database on Any Site
>  ___________________________________________________________
>  Ambassador at FourthWorld.com       http://www.FourthWorld.com
>  Tel: 323-225-3717                       AIM: FourthWorldInc
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list