Thread: Ripping websites apart and putting them back together...

  1. #16
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I type "[s]he" by habit rather than just "he". Usually it prevents people from taking offense. I've never had someone take offense before because of it. Sorry.

    Now that I see how people see it, I will zip all the achives.
    On my website, I used to have all of the files separately available for download and in an archive, because I had so much free space on the web server. But it's a pain to keep all of those files straight, and even more of a pain to download. Now I only have the really big files available separately (like SDL.DLL).
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #17
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Hmmm, good point Koni.

    EDIT @dwks:
    Yeah, guess it was my mistake, but maybe you should use "(s)he" rather than "[s]he"?

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Neat, I didn't know deleted messages showed up like that.

    Yeah, guess it was my mistake, but maybe you should use "(s)he" rather than "[s]he"?
    That's the standard used in published literature, but since in several programming contexts square brackets indicate optional characters, I like using them for some reason.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #19
    Lean Mean Coding Machine KONI's Avatar
    Join Date
    Mar 2007
    Location
    Luxembourg, Europe
    Posts
    444
    Quote Originally Posted by dwks View Post
    On my website, I used to have all of the files separately available for download and in an archive, because I had so much free space on the web server. But it's a pain to keep all of those files straight, and even more of a pain to download. Now I only have the really big files available separately (like SDL.DLL).
    Server-side scripting languages like PHP can gzip files on the fly, so you only ever have put one type of files on the server.

    The entire code is:
    Code:
    <?php
      file_put_contents('output.gz', gzencode( file_get_contents('input.file'),9));
    ?>

  5. #20
    Lean Mean Coding Machine KONI's Avatar
    Join Date
    Mar 2007
    Location
    Luxembourg, Europe
    Posts
    444
    I did a little research on how to create a TAR archive using php. Although this isn't supported by a PHP extension, there's a pear package that does that just fine, called Archive_Tar.

    The whole code to tar and gzip several files is here:
    Code:
    <?php
    
    // include class
    require("Archive/Tar.php");
    
    // create Archive_Tar() object
    // specify filename for output file
    $tar = new Archive_Tar("data.tar.gz", "gz");
    
    // set up file list
    $files = array("images/blank.gif", "images/close.gif", "images/closelabel.gif", "images/thumb-1.jpg");
    
    // build archive
    $tar->create($files) or die("Could not create archive!");
    
    ?>

  6. #21
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    You have no idea how much I need that code for my little DB project Well, maybe you do. Well, I didn't know I needed it until I read it just there, but it's very handy!

  7. #22
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    That's a good idea, you know. I should use something like that. (My server does support PHP, luckily.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed