Samba question.

ron

Member
I'm working on an AIX server. There is a script that imports files from a remote Windows box using Samba - and then loads the data into a Progress DB. (I'm quite familiar with Unix and Progress - but not Windows or Samba.)

My concern is that the script has no handshaking logic at all. If (using Samba) it "sees" a remote file it simply copies it and then deletes it. If the remote system were Unix then I would be sure there is a risk that the file could be incomplete. Is the same thing true for Windows/Samba?

Ron.
 
Just like with UNIX, it depends on how the other side is making the file appear.

The safe way to do it is to rename the file as the last step of whatever process or script creates it.

The two main variations of that are to rename using a new extension:

ren file.tmp file.dat

or rename it to a different "folder" (us UNIX guys call them directories) that is on the same "drive" (us UNIX guys refer to filesystems...):

ren \tmp\file.dat \import\file.dat

That would all be perfectly safe with Samba. This would NOT be safe:

ren c:\tmp\file.dat x:\tmp\file.dat

(It might not even work -- I don't know what Windows does when a rename crosses drives -- but if it works it is almost certainly unsafe.)
 
Thanks very much, Tom. You have confirmed my suspicion that there is a problem lurking there ...

Ron.
 
That would all be perfectly safe with Samba. This would NOT be safe:

ren c:\tmp\file.dat x:\tmp\file.dat

(It might not even work -- I don't know what Windows does when a rename crosses drives -- but if it works it is almost certainly unsafe.)

In Unix rename and move are the same command: mv. In Windows they are separate commands, and rename (or ren) only changes the filename, not the path:

Code:
C:\temp>ren /?
Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.
 
Back
Top