Net::H...foItem(3pm)

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, meet Net::Hotline::FileInfoItem โ€” it's the file object that Net::Hotline::Client uses internally. that's the whole thing. it's giving "background character who's actually carrying the plot" โœจ

(this page is from the User Contributed Perl Documentation section, and yeah the title is literally <lavender>Net::H...foItem(3pm)</lavender> because the man page header couldn't fit the whole name in the margin ๐Ÿ˜ญ iconic honestly)


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

use Net::Hotline::FileInfoItem;

$file = new Net::Hotline::FileInfoItem;

$file->name("smile");
$file->comments("A happy file.");
...

like. look at that. smile? a happy file? we love a wholesome little object ๐Ÿซถ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so <pink>Net::Hotline::FileInfoItem</pink> is a simple class โ€” a lil container for storing and retrieving file information. that's its whole job. it is not doing side quests.

here's the important part, no cap: if you're using <cyan>Net::Hotline::Client</cyan>, you should never have to create your own <pink>Net::Hotline::FileInfoItem</pink> objects. like, never ever. getting attributes is basically all you'll ever need, and setting them is a thing you can do, but to a lesser extent. that's it. that's the scope.


๐ŸŒธ CONSTRUCTION ๐ŸŒธ

  • new โ€” makes you a brand new <pink>Net::Hotline::FileInfoItem</pink> object, with every single attribute set to undef. a blank slate. a fresh face. a baby ๐Ÿฃ

โœจ METHODS โœจ

every method here is a simple attribute get/set routine. the rules are:

  • if you hand it an argument, it sets that attribute.
  • in all cases, it returns the current value of that attribute.

that's the entire pattern, bestie. you already know it. iykyk.


๐Ÿ“ comment TEXT

the file comments, exactly as they show up in the Mac OS Finder.

๐Ÿ‘€ heads up: the SYNOPSIS up there calls $file->comments("A happy file."); โ€” yes, with an s. the method documented here is comment. i'm just telling you what the page says, don't shoot the messenger ๐Ÿ’€

๐Ÿงš ctime NUM

the creation time of the file, given as a Mac OS native time value. to turn it into seconds since the Unix epoch, add the constant <mint>Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME</mint> to it. math girlies rise up ๐Ÿงฎ

๐Ÿ’œ creator TEXT

the file creator, given as a four-letter Mac OS creator code ("TTXT", "SIT!", etc.)

โญ name TEXT

the file name. that's it. the name of the file. slay.

๐ŸŒˆ icon

the file icon, given as a four-letter code.

๐Ÿ’… mtime NUM

the modification time of the file, given as a Mac OS native time value. add the constant <mint>Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME</mint> to it to change it to seconds since the Unix epoch.

๐ŸŽ€ ctime NUM

the creation time of the file, given as a Mac OS native time value. add the constant <mint>Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME</mint> to it to change it to seconds since the Unix epoch.

๐Ÿ’€ not me telling you twice โ€” yes, ctime really is listed twice in the original. we're keeping it. no edits, no notes, we honor the source material periodt.

๐Ÿฆ‹ size NUM

the size of the file, in bytes.

๐Ÿ‘‘ type TEXT

the file type, given as a four-letter Mac OS type code ("TEXT", "PICT", etc.), or <mint>Net::Hotline::Constants::HTLC_INFO_FOLDER_TYPE</mint> for folders, and <mint>Net::Hotline::Constants::HTLC_INFO_FALIAS_TYPE</mint> for folder aliases. one method, three moods ๐Ÿ’ซ


๐ŸŒŸ AUTHOR ๐ŸŒŸ

John C. Siracusa (siracusa@mindspring.com)


Copyright(c) 1999 by John Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's a wrap on <lavender>Net::H...foItem(3pm)</lavender>, bestie ๐Ÿ’… this lil page rode in with perl v5.32.0 and got stamped 2021-01-09, and honestly? it ate. go get those attributes. mwah ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from