Sympa::Tools::File(3Sympa)

πŸ’– Sympa::Tools::File πŸ’–

okay bestie, welcome to Sympa::Tools::File(3Sympa) β€” this is the file-handling corner of sympa 6.2.80 and it's honestly giving backstage-pass energy. it's a Perl package, lowercase-manual-name Sympa::Tools::File, and it's where all the little filesystem chores live. πŸŽ€


✨ NAME ✨

Sympa::Tools::File β€” File-related functions πŸ¦‹


🌸 DESCRIPTION 🌸

So basically this package is a grab-bag of file-related functions. that's the whole vibe. it does file stuff. iconic. πŸ’…

🧚 Functions 🧚

okay here's the lineup, no skips, all of them, fr fr:

  • set_file_rights(%parameters) β€” sets the owner and/or the access rights on a file.

returns a true value if the rights-setting actually succeeded. otherwise it returns a false value. 😭

⚠️ note bestie: if superuser was specified as owner, this function will die. like, straight up. don't do it.
  • copy_dir($dir1, $dir2) β€” copies a directory and its content. the whole thing. everything in it. ✨
  • del_dir($dir) β€” deletes a directory and its content. πŸ’€ be normal about it.
  • mk_parent_dir($file) β€” this one you use before you create a file inside a directory that might not exist yet. it's the "make it make sense first" helper. 🫢
  • mkdir_all($path, $mode) β€” recursively creates a directory and all its parent directories. goblin mode directory creation. πŸ‘‘
  • shift_file($file, $count) β€” shifts a file by renaming it with a date. if $count is defined, it keeps $count file and unlinks the others. so like, rotation energy. 🌈
  • get_mtime ( $file ) β€” gets the modification time of the file.

parameter:

  • $file β€” full path of file.

returns:

  • the modification time as UNIX time.
  • if the file is not found β€” and yes, that includes the case where the file vanishes mid-execution of this function, rude β€” or if it's not readable, it returns "POSIX::INT_MIN".
  • in case of any other error, it returns "undef".
  • list_dir($dir, $all, $original_encoding) β€” DEPRECATED. 🚫

recursively lists the content of a directory. returns an array of hash, with each entry holding directory + filename + encoding.

  • get_dir_size($dir) β€” TBD. that's literally all it says bestie. it's a mystery. πŸ™ˆ
  • qencode_hierarchy() β€” DEPRECATED. 🚫

Q-encodes a complete file hierarchy. useful to Q-encode subshared documents.

ToDo: see a comment on "qencode_filename" in Sympa::Tools::Text.

  • remove_dir(@directories) β€” function for removing a non-empty directory. it takes a variable number of arguments: it can be a list of directory, or a few directory paths. you choose. 🌟

πŸ“œ HISTORY πŸ“œ

Sympa::Tools::File appeared on Sympa 6.2a.41. a legend was born, no cap. ⭐


and that's the whole page, bestie β€” this was Sympa::Tools::File(3Sympa) from sympa 6.2.80, dated 2026-10-19. go forth and file responsibly πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from