Hi, I\m writing a VFS module that needs to move a file, after it is transferred, to a folder that is not shared. The shared folders that use this VFS module are used to sent files for processing by another application. The module signals the application that it has work to do and moves the file. So far I've been using the last close call, moving the file after doing SMB_VFS_NEXT_CLOSE(). This works fine for clients form Linux, Windows and, AIX. However MACs (tested on 10.6) seem to do some extra operations after close. When moving the file an error is displayed on MAC.? My question is: Is there a better way then the close call to know when a client is done with the file, and it's safe to move it? Thank you, Ovidiu.
On Wed, Nov 21, 2012 at 08:07:39AM -0800, Ovidiu Barzan wrote:> Hi, > > I\m writing a VFS module that needs to move a file, after > it is transferred, to a folder that is not shared. > The shared folders that use this VFS module are used to > sent files for processing by another application. The > module signals the application that it has work to do and > moves the file. > > So far I've been using the last close call, moving the > file after doing SMB_VFS_NEXT_CLOSE(). > When moving the file an error is displayed on MAC.? > > My question is: > > Is there a better way then the close call to know when a > client is done with the file, and it's safe to move it?Wait a minute or two after the last close? I don't think there is a really bullet-proof way over which the client tells the server it's done with the file. The protocol has no operation for that. With best regards, Volker Lendecke -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen http://www.sernet.de, mailto:kontakt at sernet.de
On 21.11.2012 17:07, Ovidiu Barzan wrote:> Is there a better way then the close call to know when a client is done with the file, and it's safe to move it? >If you have any influence on the client-side process that generates the file, the easiest and safest way would be to write the file with a temporary filename (let's say with a ".tmp" suffix), and let the client rename the file to its final name only after it is "done" with it. Let your VFS module ignore temporary files, and you should be safe. (This also works nicely for FTP uploads where some server-side process needs to know when an upload is complete.) -- Mit freundlichen Gr??en Sven Tegethoff EDV-Team _________________________________________________________ UDO B?R GmbH & Co. KG F?rstenstra?e 18 47051 Duisburg Tel.: +49 (0) 203 28117-142 Fax: +49 (0) 203 28117-151 E-Mail: tegethoff at udobaer.de Ust.-Idnr.: DE119562189, HRA 6056, Sitz der Gesellschaft: Duisburg, Gerichtsstand: Duisburg Gesch?ftsf?hrer: Bodo Badnowitz, J?rgen Dietz Ein Unternehmen der BTI Gruppe: www.bti-group.com Diese E-Mail enth?lt vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.