Forum: Ruby on Rails Managing file and directories using Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
onno.van.der.straaten (Guest)
on 2005-12-05 17:31
(Received via mailing list)
Hi group,

I was wondering how you would go about managing files and folders using
Ruby and ROR.

The Ruby script I'm writing traverses a directory tree and manipulates
the content of files.  This is all relatively straightforward but what I
cannot find is information on how to access file properties such as
creation, modification date.

I'm using 'find' and 'fileutils'

Kind regards,

Onno





This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied, disclosed to, retained or used by, any other party. If you are
not an intended recipient then please promptly delete this e-mail and
any attachment and all copies and inform the sender. Thank you.
technoweenie (Guest)
on 2005-12-05 17:39
(Received via mailing list)
On 12/5/05, Straaten, Onno van der <removed_email_address@domain.invalid>
wrote:
> find is information on how to access file properties such as creation,
> modification date.
>
> I'm using 'find' and 'fileutils'

File.mtime('filename')

Also look at File::Stat
http://ruby-doc.org/core/classes/File/Stat.html


--
rick
http://techno-weenie.net
This topic is locked and can not be replied to.