\n"; // Echo "RootDir: ".$RootDir."
\n"; // We'll need access to the Global Variables: // include_once("$DOCUMENT_ROOT/include/GlobalVars.php"); // To get rid of: Warning: include_once() [function.include-once]: Unable to access /include/GlobalVars.php in include_once("$RootDir/include/GlobalVars.php"); // We will be accessing all sorts of functions: //include_once("$DOCUMENT_ROOT/include/Functs.php"); include_once("$RootDir/include/Functs.php"); // Check to see if the visitor (USER_AGENT) is a spider. If not: // then do a "session_start"... // Creates a session or resumes the current one // based on the current session id that's being passed via a // request, such as GET, POST, or a COOKIE. // It's necessary that this be the first PHP command in the file. If (!ItsASpider()) { session_start(); // Sets various session variables like ReferringURL and EntryURL // if they haven't already been set // include_once("$DOCUMENT_ROOT/include/SetSessionVars.php"); include_once("$RootDir/include/SetSessionVars.php"); } // This turns on Output Buffering. This seems to be // necessary because we may be redirecting to a "Thank You" page // after they submit the form. Speeds things up because // browser doesn't reload when hitting BACK button. ob_start(); // PageNameStr - This is the dominant keyword phrase for the page. // Goes in comments, header bars, IMAGE ALT tags, etc. Only about 10 words! $PageNameStr="How to Keep the Dates and Times preserved when copying files in FreeBSD / UNIX / Linux Command line"; // This is the first line string. It goes at the very top of the page. // If this is NOT a doorway page, then set the $PageFirstLineStr: // Notice: Undefined variable: ThisIsDoorway // IF (!($ThisIsDoorway)) // If not set, then set it to get rid of error message: If (!IsSet($ThisIsDoorway)) {$ThisIsDoorway=0;} If ($ThisIsDoorway<>1) {$PageFirstLineStr="FreeBSD Copy Files Without killing time stamp - How to Keep and Preserve the Date and Time on Copied Files When Using the cp Command in FreeBSD / Unix / Linux";} // This is the first text after the first line, // that usually shows up in the upper left corner $PageFirstTextStr="${CompanyStr}

FreeBSD Copy Date Time Stamp"; // This is the second text after the first line, // that usually shows up in the upper right corner $PageSecondTextStr="${CompanyDomain}

FreeBSD - Keep Dates Times Copy"; $PageTitleStr=$PageFirstLineStr; $PageKeywordStr=$PageNameStr; $PageCommentStr="FreeBSD How to Keep and Preserve the Date and Time Stamp Attributes When Copying Files - Using the cp Command to Copy Files, but Preserving the Dates and Times, Configuration, Linux, Unix, Nix, Hard Disks, CD, Keyboard, Cheat Sheet for FreeBSD, Configure, Options, Configuration, Howto, How To, FreeBSD"; // $PageDescriptionStr=""; // $PageRobotsStr=""; // If this is NOT a doorway page, then include header.php: IF (!($ThisIsDoorway)) { include_once("$RootDir/include/header-brief.php"); } ?>

HOW TO PRESERVE THE DATE AND TIME STAMP ATTRIBUTES WHEN USING THE 'cp' COMMAND WITH FREEBSD


    ASSUMPTIONS:

    You have already installed FreeBSD.  If not, then click here: How to Install FreeBSD


    COPYING FILES WITHOUT DESTROYING THE DATE AND TIME STAMP

  1. It's kind of bizarre, but when you copy files with the 'cp' command in FreeBSD, the 'modified' date and time are bumped up to the current date and time.  This is really annoying if you depend on the information that the modified time stamp gives you.

    The workaround is simple: just add the '-p' (P)reserve option whenever you use the 'cp' command, and it will preserve the modified date and time, as well as all the other file attributes and permissions:

    cp   -p   /sourcedir/somefile.txt   /targetdir/newname.txt


    Be aware that the 'accessed' date will change, however