file attributes to txt file script

Discussion in 'Mac Programming' started by diegoborgh, Dec 22, 2009.

  1. diegoborgh macrumors newbie

    Joined:
    Apr 14, 2007
    #1
    Hi,

    I need desperately a script that can take some file attributes from a folder and write them down in a txt file.
    Basically I need the name.extension, byte size and timestamp, tab delimited.
    How can I do this?

    Thanks!
     
  2. MacForMeOneDay macrumors member

    Joined:
    Jun 16, 2007
    #2
    In Terminal, you can run:
    ls -l folderofinterest > txtfile
    Where folderofinterest is the folder but will list all the files within it. If you just want the directory itself, use "-d". txtfile is the name of the file you want to send the information to. You can run it on a commandline/terminal without the "> txtfile" part to see if meets your needs.

    Do a man on ls for more information.
     

Share This Page