NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PhpEd is unlinking HardLinks after FileSave


Joined: 24 Nov 2010
Posts: 21
Reply with quote
If i open hardlinked file and save it in IDE - hardlink will lost. Confused
View user's profileFind all posts by exedSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
Depending on how the Nusphere text editor saves files, you might find hardlinks will not work as expected.

One possible workaround is to create a symbolic link to a folder and have the files in there. Then the files themselves are not hardlinked and you will hopefully find those file(s) will save without any problems.
View user's profileFind all posts by plugnplaySend private message


Joined: 24 Nov 2010
Posts: 21
Reply with quote
Symbolic link to a folder is not need me in my task. I need use same file with different names on server and localhost. HardLink solve this problem.
View user's profileFind all posts by exedSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
A problem with hardlinks and text editors is that many editors will save as a new temporary file, delete the original file then rename the temporary file to the original file name.

This is a safe way of saving because if the save of the new temporary file fails, you still have the original file. Some text editors will also rename the original file to something like name.bak as a backup.

This renaming and deletion process means you will lose the hardlink.

The method of saving that would work is for a text editor to truncate the original file then append write to it. Many Windows editors will not do that, but I just checked UltraEdit (www.idmcomp.com) and that does support saving files directly back with creating a backup or using a temporary file. It also supports PHP syntax, but you will miss out on the PhpED stuff.
View user's profileFind all posts by plugnplaySend private message


Joined: 23 Aug 2005
Posts: 53
Reply with quote
phped changed something with build 5989. i have almost the same problem, my php files are on a remote samba share and have special file permissions set on them. with build 5988 i can open/edit/save a file without loosing the permissions. with build 5989 it will create a new file and loose the permissions.

i logged a tickted for it and they came back with the same explanation as above.
Quote:
According to our engineering, they changed the way we save file - now we create a temp file, delete the original one and rename the temp one. That's how all major editors work.
So the saved filed will have the permissions as per user account which opened the windows share (again, it's the default and correct way). Please adjust the permissions as per your security model.
Best regards,
Support

mabye they can change it back or change it like this:
- create a copy of the current file with exstension .bak or .org
- truncate the current file
- fill the file with the new data
- and if all is successfull delete the .bak file
View user's profileFind all posts by stappelSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Should be fixed in build 5990.
Please check.
View user's profileFind all posts by mdegtyarevSend private message


Joined: 24 Nov 2010
Posts: 21
Reply with quote
ver. 5990 save SymLinks, thx.
View user's profileFind all posts by exedSend private message
PhpEd is unlinking HardLinks after FileSave
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic