This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deletion of symbolic links on NFS / Samba bug

 
Post new topic   Reply to topic    Total Commander Forum Index -> Bug reports from previous betas (unresolved) Printable version
View previous topic :: View next topic  
Author Message
ericgur
Junior Member
Junior Member


Joined: 17 Aug 2008
Posts: 3

PostPosted: Sun Aug 17, 2008 1:16 am    Post subject: Deletion of symbolic links on NFS / Samba bug Reply with quote

I'm using a shared file system (NFS / Samba) that is used by both Linux and Windows clients.
Like many Linux file systems, it has soft (symbolik) links to files and directories.
The correct behavior for deleting (or copying) such soft links is to delete (or copy) the link itself and not the actual file or dirctory pointed by the link.
The same behaviour of the UNIX command:
rm -fr <dir-names>
or
rm -fr <file-names>

It's very common that soft links point to other mounts and/or higher up the directory tree.
Deleting soft links like normal directories is extremely dangerous. The user is not always aware of exact directory structures.

Not having the option to delete or copy files on NFS is very crippling.

I'm using:
TC 7.04a
Window XP Pro SP3 fully patched
NFS access via Linux Samba servers.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Mon Aug 18, 2008 10:15 am    Post subject: Reply with quote

Total Commander handles links on NTFS drives correctly. Apparently Samba links cannot be detected this way, so TC sees them as normal files/folders. I don't think that there is any way to detect Samba links from Windows (or is there?), so all I can recommend is that you don't use any - you would see the same problem in Explorer too...
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ericgur
Junior Member
Junior Member


Joined: 17 Aug 2008
Posts: 3

PostPosted: Tue Aug 19, 2008 12:19 am    Post subject: Reply with quote

Explorer is behaving similar to TC in this sense, it even displays an error which TC doesn't, but files are still deleted.

Sadly, I must use soft links (at work) so I need a workaround.
Is it possible for TC to call 'delete file' on network directories first as if they were files:
* Success -> this was a soft link
* Fail -> probably directory, delete directory like before.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Wed Aug 20, 2008 9:35 am    Post subject: Reply with quote

Well, that's EXACTLY what Total Commander already does! It tries to remove the directory, then verifies via FindFirstFile whether it's still there (some servers report success although they fail to delete the directory). If this happens, TC reports an error and offers to delete the contents of the non-empty directory.

Maybe your server still lists the directory even after the remove call, and deletes it with a longer delay? I don't currently see how to avoid that situation because the return value of the directory delete function is unreliable too...
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ericgur
Junior Member
Junior Member


Joined: 17 Aug 2008
Posts: 3

PostPosted: Thu Aug 21, 2008 12:58 am    Post subject: Reply with quote

I'll try to solve this problem using my own code. If I'm successful, I'll post the code. I'll write a simple program that deletes files and directories over the network.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Bug reports from previous betas (unresolved) All times are GMT - 6 Hours
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


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group