rename() with a hash (or pound) in the filename

This is a discussion on rename() with a hash (or pound) in the filename within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, Running PHP4 on Win32, can't seem to rename files with a '#' (there are some other char's that ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2004
Troy
 
Posts: n/a
Default rename() with a hash (or pound) in the filename

Hi,

Running PHP4 on Win32, can't seem to rename files with a '#' (there
are some other char's that I think I have a problem with as well, such
as '!' but have not confirmed)

I really don't know where to start looking to even try and debug this
- all I get is a false return from rename() - (copy also fails).

TIA,
Troy
Reply With Quote
  #2 (permalink)  
Old 02-28-2004
Andy Hassall
 
Posts: n/a
Default Re: rename() with a hash (or pound) in the filename

On 28 Feb 2004 04:03:13 -0800, google@f0rge.ws (Troy) wrote:

>Running PHP4 on Win32, can't seem to rename files with a '#' (there
>are some other char's that I think I have a problem with as well, such
>as '!' but have not confirmed)
>
>I really don't know where to start looking to even try and debug this
>- all I get is a false return from rename() - (copy also fails).


Works for me, Win2k+PHP4.3.3.

<pre>
<?php
var_dump(is_file('test'));
var_dump(is_file('test#'));
echo "\n";
var_dump(rename('test', 'test#'));
var_dump(is_file('test'));
var_dump(is_file('test#'));
echo "\n";
var_dump(rename('test#', 'test'));
var_dump(is_file('test'));
var_dump(is_file('test#'));
?>
</pre>

Outputs:

bool(true)
bool(false)

bool(true)
bool(false)
bool(true)

bool(true)
bool(true)
bool(false)

Platform (more specifically than win32?)? PHP version? Filesystem type?

Do you have error_reporting set to E_ALL, and display_errors on, so you can
see the warnings? (Or look in your error log).

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Reply With Quote
  #3 (permalink)  
Old 04-06-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: rename() with a hash (or pound) in the filename


"Troy" <google@f0rge.ws> wrote in message
news:f391dfeb.0402280403.2ef11587@posting.google.c om...
> Running PHP4 on Win32, can't seem to rename files with a '#' (there
> are some other char's that I think I have a problem with as well, such
> as '!' but have not confirmed)
>
> I really don't know where to start looking to even try and debug this
> - all I get is a false return from rename() - (copy also fails).
>


Check if the files you are trying to renamed aren't temporary files which
are used by the OS or an application by renaming them manually.

JW



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:06 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0