Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Unable to write file: smarty_internal_write_file.php ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
clone46
Smarty Rookie


Joined: 13 Jan 2006
Posts: 15

PostPosted: Mon Dec 26, 2011 11:56 pm    Post subject: Unable to write file: smarty_internal_write_file.php ? Reply with quote

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
View user's profile Send private message
clone46
Smarty Rookie


Joined: 13 Jan 2006
Posts: 15

PostPosted: Tue Dec 27, 2011 1:42 am    Post subject: Reply with quote

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. Smile I fixed my problem by moving my project working directory to C:\workspace

Thanks!
- Bret
Back to top
View user's profile Send private message
clone46
Smarty Rookie


Joined: 13 Jan 2006
Posts: 15

PostPosted: Tue Dec 27, 2011 1:49 am    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Dec 27, 2011 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
patrick8
Smarty n00b


Joined: 26 Dec 2014
Posts: 1

PostPosted: Fri Dec 26, 2014 5:22 pm    Post subject: Reply with quote

I suggest u to try "Long Path Tool" program. for limit char case. :)hopefully can help u Smile
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Dec 26, 2014 6:08 pm    Post subject: Reply with quote

Took you only 3 years to find the topic?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP