|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 15
|
Posted: Mon Dec 26, 2011 11:56 pm Post subject: Unable to write file: smarty_internal_write_file.php ? |
|
|
Hello!
I'm working with XAMPP on a Windows XP box. I've got a similar development environment on a Windows 7 box running XAMPP with no problems. However, on my Windows XP box, I'm getting the following error:
exception 'SmartyException' with message 'unable to write file C:\Documents and Settings\Me\My Documents\Aptana Studio Workspace\mysite\application/views/templates_c\C_Documents_and_Settings_Me_My_Documents_Aptana_Studio_Workspace_mysite_application_views_scripts_homepage^8bceb4481ec50b016069a8ab08fd3f13a3fca15e.file.index.tpl.php' in C:\Documents and Settings\Me\My Documents\Aptana Studio Workspace\mysite\library\smarty\sysplugins\smarty_internal_write_file.php:55
It appears that the rename function in smarty_internal_write_file.php is not working:
Code: |
// remove original file
@unlink($_filepath);
// rename tmp file
$success = rename($_tmp_file, $_filepath); // <<<<<<< HERE!!!!
if (!$success) {
error_reporting($_error_reporting);
throw new SmartyException("unable to write file {$_filepath}");
return false;
}
|
Any suggestions?
Thanks!
- Bret |
|
Back to top |
|
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 15
|
Posted: Tue Dec 27, 2011 1:42 am Post subject: |
|
|
I figured it out. Windows XP has a 255 character limit for filenames. Maybe a feature request would be for Smarty to reduce templates_c filenames to ensure that they are less than 255 characters. I fixed my problem by moving my project working directory to C:\workspace
Thanks!
- Bret |
|
Back to top |
|
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 15
|
Posted: Tue Dec 27, 2011 1:49 am Post subject: |
|
|
Wait, I take it back. The original filename was only 166 characters long. Maybe there's a nuance in the rename() function that freaks out when the entire file path plus the file name are longer than 255 characters. Anyhow, my fix still worked. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Dec 27, 2011 12:04 pm Post subject: |
|
|
Looks like you did use the very long file path as compile_id. A comple_id like this does not make any sense to me. |
|
Back to top |
|
patrick8 Smarty n00b
Joined: 26 Dec 2014 Posts: 1
|
Posted: Fri Dec 26, 2014 5:22 pm Post subject: |
|
|
I suggest u to try "Long Path Tool" program. for limit char case. :)hopefully can help u |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Dec 26, 2014 6:08 pm Post subject: |
|
|
Took you only 3 years to find the topic? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|