10 Replies - 1734 Views - Last Post: 17 October 2002 - 10:09 PM Rate Topic: -----

#1 bazooka tooth   User is offline

  • risky operation, but worth it.

Reputation: 0
  • View blog
  • Posts: 1,205
  • Joined: 01-October 02

Php/ Filesystem Project

Posted 17 October 2002 - 12:00 AM

alright.. i'm not looking for anyone to write code for me here or anything, so don't get that idea.. im just looking for ideas on whats the best way to go about this before i throw a lot of time into it...

i need to list a unix directory(that will probably have a whole lot of files in it)
and
allow each of those files to be able to be selected somehow
and
their exact filenames (not locations) to be stored in a variable.

this is all going to be done via a website that is already in place.
::smoosh!::

Is This A Good Question/Topic? 0
  • +

Replies To: Php/ Filesystem Project

#2 Taranis   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 15-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 06:25 AM

You might download Andromeda and take a look at how it parses a file folder. The interface is nicely done as well. The script itself is highly configurable for filetypes and such.

You might could strip it down and then get some ideas from how he parses the filestructure. I would think you would want to give him some credit if his ideas inspire you.
Was This Post Helpful? 0
  • +
  • -

#3 bazooka tooth   User is offline

  • risky operation, but worth it.

Reputation: 0
  • View blog
  • Posts: 1,205
  • Joined: 01-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 07:07 AM

Thanks.. I think I'll buy it and spend all day at work deconstructing the code.
Was This Post Helpful? 0
  • +
  • -

#4 Taranis   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 15-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 07:46 AM

mudslideslim, on Oct 17 2002, 08:07 AM, said:

Thanks.. I think I'll buy it and spend all day at work deconstructing the code.

Is that sarcasm? I was just trying to help.

You can download a free version.
Was This Post Helpful? 0
  • +
  • -

#5 bazooka tooth   User is offline

  • risky operation, but worth it.

Reputation: 0
  • View blog
  • Posts: 1,205
  • Joined: 01-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 09:45 AM

No, I was totally serious. That's what I've been working on today.. I even showed my boss and let him know what I was up to.
Was This Post Helpful? 0
  • +
  • -

#6 bazooka tooth   User is offline

  • risky operation, but worth it.

Reputation: 0
  • View blog
  • Posts: 1,205
  • Joined: 01-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 10:59 AM

One problem.. its not opensource. Still open for suggestions guys, that was a wee bit too much.
Was This Post Helpful? 0
  • +
  • -

#7 Taranis   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 15-October 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 11:13 AM

Do you know Perl? You might could adapt some of these ideas and find analogous methods in PHP.

Here's something I found in Perl that parses the filestructure: http://www.tech-geek...dex/Readme.html

It is open-source under a GPL, so you could use it to build off of.

I hate be presumptuous or condescending, but you might also familiarize yourself with all the php filesystem functions. I find when starting to develop functionality I haven't worked on before that getting a handle on all the built-in abilities of the language for that task can spur inspiration.
Was This Post Helpful? 0
  • +
  • -

#8 skrilla   User is offline

  • boots.

Reputation: 2
  • View blog
  • Posts: 3,096
  • Joined: 05-July 02

Re: Php/ Filesystem Project

Posted 17 October 2002 - 01:33 PM

PHP.net search for 'file' in the 'function search' box. it will give you all sorts of fun things to learn and do. the ultimate PHP resource. go for it! :t_up:

:pirate:
Was This Post Helpful? 0
  • +
  • -

#9 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1982
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Php/ Filesystem Project

Posted 17 October 2002 - 01:55 PM

we use a similar system for our newsletter script, it takes the names of files in a newsletter directory and actually parses them into a readable date, but we load it into an array, I think I used the file function for the task.

*goes to find code*
Was This Post Helpful? 0
  • +
  • -

#10 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1982
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Php/ Filesystem Project

Posted 17 October 2002 - 01:57 PM

k, here is the entire thing... take out the date functions and such and you've got what you need f00

<?

 	 $handle=opendir('/hsphere/local/home/dreaminc/home.dreamincode.net/newsletters'); 

 	 while (false!==($file = readdir($handle))) { 

    if ($file != "." && $file != ".."

&& $file != "newsletters.php") {

   	 $filename = str_replace("_"," ",$file);

                    $month = substr("$filename", 0, 2); 

   	 $day = substr("$filename", 2, 2);

   	 $year = substr("$filename", 4, 2);

   	 $year = "20".$year;

   	 $newsletter_date = mktime (0,0,0,$month,$day,$year);

   	 $newsletter_date = date("F d, Y", $newsletter_date);

   	 $filename = str_replace(".php","",$filename);

   	 echo "<li><b><a href='/newsletters/$file' target=_blank>$newsletter_date</a></b></li>"; 

    } 

 	 }

 	 closedir($handle);

?>


Was This Post Helpful? 0
  • +
  • -

#11 gneato   User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: Php/ Filesystem Project

Posted 17 October 2002 - 10:09 PM

Chris, that will only work for 97 more years! :crazy:

:D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1