PDA

View Full Version : importing last modified obj from a folder



luizelias3d
06-02-11, 11:24 AM
hello!
Im trying to do a simple script that imports the last modified obj file from a specified folder. Anyone knows how to list files from a folder in "last modified order"?

thanks!

marcus_civis
06-03-11, 02:04 PM
There's a zscript command [FileGetInfo] which you could use provided you have a list of possible names you can loop through to check:



[FileGetInfo,File name including the extension (such as brush1.ztl ).,The information requested index.]
Retrieve information about a specified file.
Output: Returns the requested information or zero if file not found.
[FileGetInfo,LargeImage.psd,1] Returns the size of the specified file.

Property indexes:

1 = file size (in MB)
2 - 7 = creation date: year, month (1 - 12), day, hour, minutes, seconds
8 - 13 = modified date: year, month (1 - 12), day, hour, minutes, seconds
14 - 19 = access date: year, month (1 - 12), day, hour, minutes, seconds

If you don't have a list of possible files then you would need a DLL as there's no way to do it with just zscript.