Archive

Posts Tagged ‘file’

URI vs URN vs URL

Mar 13th, 2010

Do you know what does URI, URL and URN means? I bet you will say that I know about URL but what about URI and URN! Here is a good description on Wikipedia and that is enough to understand these three:
URI tells a unique path to a resource on… READ MORE

Handling File Read/write Concurrency Problem in PHP

Feb 23rd, 2010

Recently I need to use file for caching little bit of data. Then I thought of concurrency problem can arise in File based structure due to read/write issue. For small data and that also if  not so useful , usage of Database can be avoided. Though Database can handle any… READ MORE

PHP: Getting File extension and file basename

Jan 31st, 2010

Here is a script for getting file extension. It will take care of the file name like this: yourfilename.inc.php etc and not only filename.inc or fileename.php. It will get your last part of file irrespective of how many dots in file.
<?php
// will get the file name out of… READ MORE

PHP require/include and relative path error

Jan 7th, 2010

It is little difficult to get the right path in PHP sometime. PHP gets the path based on top page. To get the right path two functions are very useful – getcwd() and realpath(). To get what PHP is understanding of your supplied path for require/include, use realpath(). It will… READ MORE

Getting all Parent Folders of a Folder and File

Dec 26th, 2009

I need to get all the parent folders of a File for a work. I searched on net to find easy solution for this and also to find some tips for my work. As, my work was heavily dependent on this logic, so I have given some time to it.… READ MORE

Unique Identification for file/ folder name, ID, table key, invoice/ order number

Jul 8th, 2007

We need create unique number/name/values for various reasons. We need to create files with unique names, unique folders names, and primary key in table, index key in table and invoice number, order no and so on.
Create file with unique file name
PHP function tempnam() (not tempname ())
Syntax: string… READ MORE