GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
App::PFM::Directory(3) User Contributed Perl Documentation App::PFM::Directory(3)

App::PFM::Directory

PFM Directory class, containing the directory contents and the actions that can be performed on them.

_init(App::PFM::Application $pfm, App::PFM::Screen $screen, App::PFM::Config $config, App::PFM::OS $os, App::PFM::JobHandler $jobhandler, string $path)
Initializes new instances. Called from the constructor.
_clone(App::PFM::Directory $original [ , array @args ] )
Performs one phase of the cloning process by cloning an existing App::PFM::Directory instance.
_install_event_handlers()
Installs listeners for the events 'after_set_color_mode' (fired by App::PFM::Screen) and 'after_change_formatlines' (fired by App::PFM::Screen::Listing), that require reformatting of the File objects.
_by_sort_mode()
Sorts two directory entries according to the selected sort mode. Dotdot mode is taken into account.
_sort_multilevel(string $sort_mode)
Recursively sorts two directory entries according to the selected sort mode string (multilevel).
_sort_singlelevel(char $sort_mode)
Sorts two directory entries according to the selected sort mode character (one level).
_init_filesystem_info()
Determines the current filesystem usage and stores it in an internal hash.
_init_dircount()
Initializes the total number of entries of each type in the current directory by zeroing them out.
_countcontents(array @entries)
Counts the total number of entries of each type in the current directory.
_readcontents(bool $smart)
Reads the entries in the current directory and performs a stat() on them.

If smart is false, the directory is read fresh. If true, the directory is refreshed but the marks are retained.

_sortcontents()
Sorts the directory's contents according to the selected sort mode.
_filtercontents()
Filters the directory contents according to the filter modes (displays or hides dotfiles and whiteouts).
_catch_quit()
Catches terminal quit signals (SIGQUIT).
destroy()
Unregisters our 'after_change_formatlines' and 'after_set_color_mode' event listeners with the App::PFM::Screen and App::PFM::Screen::Listing objects. This removes the references that they have to us, readying the Directory object for garbage collection.
path()
Getter for the current directory path. Setting the current directory should be done through App::PFM::Directory::chdir() or App::PFM::Directory::prepare().
dircontents( [ arrayref $dircontents ] )
Getter/setter for the $_dircontents member variable, which points to the complete array of files in the directory.
showncontents( [ arrayref $showncontents ] )
Getter/setter for the $_showncontents member variable, which points to the array of the files shown on-screen.
total_nr_of()
Getter for the hash which keeps track of how many directory entities of each type there are.
marked_nr_of()
Getter for the hash which keeps track of how many directory entities of each type have been marked.
disk()
Getter for the hash which keeps track of filesystem information: usage, mountpoint and device.
mountpoint( [ string $mountpoint ] )
Getter/setter for the mountpoint on which the current directory is situated.
device( [ string $device ] )
Getter/setter for the device on which the current directory is situated.
path_mode( [ string $path_mode ] )
Getter/setter for the path mode setting ('phys' or 'log')
ignore_mode( [ bool $ignore_mode ] )
Getter/setter for the ignore mode setting.
prepare( [ string $path ] )
Prepares the contents of this directory object. Can be used if this state should not be displayed on-screen right away.
chdir(string $nextdir [, string $direction [, bool $no_save_prev ] ] )
Tries to change the current working directory, if necessary using CDPATH. If successful, it stores the previous state in App::PFM::Application->_states and executes the 'chdirautocmd' from the .pfmrc file.

The direction argument can be 'up' (when changing to a parent directory), 'down' (when descending into a directory) or empty (when making a jump) and will determine where the cursor will be positioned in the new directory (at the previous directory when moving up, at '..' when descending, and at '.' when making a jump).

The no_save_prev argument can be used to indicate that the current state should not be saved to the "previous" state (F2 command).

addifabsent(hashref { entry => string $filename, white => char $iswhite, mark => char $mark, refresh => bool $refresh } )
Checks if the file is not yet in the directory. If not, add()s it.
add(hashref { entry => string $filename, white => char $iswhite, mark => char $mark, refresh => bool $refresh } )
Adds the entry as file to the directory. Also calls register().
register(App::PFM::File $file)
Adds the file to the internal (total and marked) counters.
unregister(App::PFM::File $file)
Removes the file from the internal (total and marked) counters.
include(App::PFM::File $file)
Marks a file. Updates the internal (marked) counters.
exclude(App::PFM::File $file [, char $to_mark ] )
Removes a file's mark, or replaces it with to_mark. Updates the internal (marked) counters.
register_include(App::PFM::File $file)
Adds a file to the counters of marked files.
register_exclude(App::PFM::File $file)
Removes a file from the counters of marked files.
ls()
Used for debugging.
set_dirty(int $flag_bits)
Flags that this directory needs to be updated. The D_* constants (see below) may be used to specify which aspect.
unset_dirty(int $flag_bits)
Removes the flag that this directory needs to be updated. The D_* constants (see below) may be used to specify which aspect.
refresh()
Refreshes the aspects of the directory that have been flagged as dirty.
checkrcsapplicable( [ string $path ] )
Checks if any rcs jobs are applicable for this directory, and starts them.
stop_any_rcsjob()
Stop an rcsjob, if it is running. Returns a boolean indicating if one was running.
preparercscol( [ App::PFM::File $file ] )
Prepares the 'Version' field in the directory contents by clearing it. If a file argument is provided, then only process this file; otherwise, process this entire directory.
reformat()
Adjusts the visual representation of the directory contents according to the new layout.
dirlookup(string $filename, array @dircontents)
Finds a directory entry by name and returns its index. Used by apply().
apply(coderef $do_this, App::PFM::Event $event, array @args)
In single file mode: applies the supplied function to the current file, as passed in $event->{currentfile}. In multiple file mode: applies the supplied function to all marked files in the current directory.

Special flags can be passed in $event->{lunchbox}{applyflags}.

If the apply flags contain 'delete', the directory is processed in reverse order. This is important when deleting files.

If the apply flags do not contain 'nofeedback', the filename of the file being processed will be displayed on the second line of the screen.

This package provides the D_* constants which indicate which aspects of the directory object need to be refreshed. They can be imported with "use App::PFM::Directory qw(:constants)".
D_FILTER
The directory contents should be filtered again.
D_SORT
The directory contents should be sorted again.
D_CONTENTS
The directory contents should be updated from disk.
D_FILELIST
Convenience alias for a combination of all of the above.
D_CHDIR
The current directory was changed, therefore, filesystem usage information should be updated from disk.
D_ALL
Convenience alias for a combination of all of the above.

A refresh need for an aspect of the directory may be flagged by providing one or more of these constants to set_dirty(), e.g.

        $directory->set_dirty(D_SORT);

The actual refresh will be performed on calling:

        $directory->refresh();

This will also reset the flags.

In addition, this package provides the M_* constants which indicate which characters are to be used for mark, oldmark and newmark. They can be imported with "use App::PFM::Directory qw(:constants)".

M_MARK
The character used for marked files.
M_OLDMARK
The character used for an oldmark (when a file has been operated on in multiple mode).
M_NEWMARK
The character used for a newmark (when a file has newly been created in multiple mode).

pfm(1).
2014-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.