I have a file (excel) hosted on a Windows machine that is shared over the network. OpenSuse can see and open that same file (using samba), however, if the file is already open it does not show me any alert notifing me about that, like it does on a Windows machine.
is it me? A bad configuration? Or a SAMBA limitation?
Is there a work-around?
I hope that between OpenSuse’s netwrok machines it works (didn’t test, so correct me if i’m wrong)…
What program in openSUSE are you expecting the read only Excel file open error message to emerge from? Please include your openSUSE version and Desktop used and if a 32 or 64 bit install. Tell us more about the server where the Excel file is located.
For more help in setting up Samba for Workgroups, have a look at my blog on the subject you can find here:
I know nothing about WIndows, but I do know that Libreoffice won’t allow opening of the same file from a network shared drive twice. And notifies the user with “File already opened by user …”.
On 2013-09-30 16:25, jdmcdaniel3 wrote:
>
> SpeccyMan;2586180 Wrote:
>> Hi,
>>
>> short and direct:
>>
>> I have a file (excel) hosted on a Windows machine that is shared over
>> the network. OpenSuse can see and open that same file (using samba),
>> however, if the file is already open it does not show me any alert
>> notifing me about that, like it does on a Windows machine.
>>
>> is it me? A bad configuration? Or a SAMBA limitation?
>>
>> Is there a work-around?
>>
>> I hope that between OpenSuse’s netwrok machines it works (didn’t test,
>> so correct me if i’m wrong)…
>>
>> Thanks
>
> What program in openSUSE are you expecting the read only Excel file open
> error message to emerge from? Please include your openSUSE version and
> Desktop used and if a 32 or 64 bit install. Tell us more about the
> server where the Excel file is located.
The question is simple.
It is a Windows machine hosting a file, shared over samba to linux machines.
When a file is opened in Windows, other applications are denied opening
it. This is native to the system, any program hits that behaviour,
excel, openoffice, etc. It is enforced.
The question is simply if samba supports that blocking mechanism when
connecting to a Windows machine, or not. That is, if the block on
Windows is exported by samba to a linux kernel block.
My educated guess: no.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
All Windows enforces blocking Writing for any file which is already open(Hardly ever a block to simply read unless special permissions are applied).
This means that no matter what situation you might imagine, if someone or something “opens” a file in Read/Write mode (typically default), then only that User can edit the file. Others can open the same file, but only in ReadOnly mode. This prevents contention when multiple people or things open a file and make changes, something would then need to arbitrate how to reconcile changes… ie, merge all changes? If multiple changes were made to the same text, are someone’s changes over-written and if so when and according to what rules plus what happens to the unapplied changes, are they simply deep-sixed without warning or notice? In other words, reconciling multiple simultaneous changes is a big headache and can lead to corruption, confusion and un-tracked losses.
UNIX (and Linux) on the other hand does not enforce file locks although it’s possible to "suggest’ or optionally apply. But, the default is no file locks. And, in general it works OK. This allows all sorts of capabilities that aren’t possible on Windows. But, the spectre of data loss is always possible so if you’re running an application that allows multiple access to files, all Users should use it and the application should implement file locks. But, at the OS level it’ll always be a maybe and not usually.
If you’re looking for simultaneous Read/Write access to the same file I can suggest 2 types of solutions
Universal realtime access to the file. An example of this is if you access a file in Google Docs (aka Google Drive) using Google Apps. Everyone has a live copy of the document, when one person edits something, the change is immediately pushed to everyone on the team that currently has the file open.
Use a special file system that tracks and preserves changes. Although this doesn’t typically resolve conflicts, it allows multiple versions of the same document for people to view, and if desired can merge document versions. No data is lost this way although it still does not address the problem how to prioritize changes. Examples of this abound in Software development, popular examples include git and svn.
Or, since you can always open a file ReadOnly, it just means that if you make changes then the file can be saved only with a different name, it cannot replace the original file.
So,
Hopefully armed with this information you might better understand why file locks exist and whether it’s something you want to verify is in force or not.
On 2013-09-30 23:56, tsu2 wrote:
>
> All Windows enforces blocking Writing for any file which is already
> open(Hardly ever a block to simply read unless special permissions are
> applied).
> This means that no matter what situation you might imagine, if someone
> or something “opens” a file in Read/Write mode (typically default), then
> only that User can edit the file. Others can open the same file, but
> only in ReadOnly mode.
Yep.
The mechanish was available even before Windows, with MsDOS. I have it
in the documentation for programmers I bought at the time.
It is even possible to block for write only a region of a file while
allowing write to another region by another application, or read to
other regions. It is quite flexible.
> UNIX (and Linux) on the other hand does not enforce file locks although
> it’s possible to "suggest’ or optionally apply. But, the default is no
> file locks. And, in general it works OK. This allows all sorts of
> capabilities that aren’t possible on Windows. But, the spectre of data
> loss is always possible so if you’re running an application that allows
> multiple access to files, all Users should use it and the application
> should implement file locks. But, at the OS level it’ll always be a
> maybe and not usually.
Yep.
The problem the OP reports is that samba does not appear to block other
users/apps/hosts from write access. I understand he wants that enforcement.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
If you’re looking for simultaneous Read/Write access to the same file I can suggest 2 types of solutions
Universal realtime access to the file. An example of this is if you access a file in Google Docs (aka Google Drive) using Google Apps. Everyone has a live copy of the document, when one person edits something, the change is immediately pushed to everyone on the team that currently has the file open.
Use a special file system that tracks and preserves changes. Although this doesn’t typically resolve conflicts, it allows multiple versions of the same document for people to view, and if desired can merge document versions. No data is lost this way although it still does not address the problem how to prioritize changes. Examples of this abound in Software development, popular examples include git and svn.
I agree with Tsu’s pragmatic advice here. FWIW, I have to connect to a remote server for r/w access to a particular spreadsheet, so I have encountered the issue of not being able to write when it was already open (but thankfully very rarely). If you have remote admin access to the server, it is possible to query the server for open files with ‘openfiles /query’, but this may change anyway by the time you go to save the file in a multi-user environment.
I’m on OpenSuse 12.3,KDE, 64BIT. The file is located on a (not-server) Windows XP machine (not 100% sure, it might be a Windows 7 (64bit)) and it’s on a shared directory.
On all machines we’re openning the excel file in LibreOffice Calc.
Now, on the case when the file is already open, all Windows machines that tries to access the file (also with LibreOffice) get the alert. However on the Opensuse there is no alert about the file being already open somewhere.
For what i could understand from the posts above, i have to manually activate the function… is that it? Or did i get it wrong?
Is the openSUSE PC the only one running Linux? The ability to determine a file is in use starts with the selected file system. Next is how access to the file from openSUSE is being gained? Is it being mapped, with a temp or permanent map? How did you setup Samba on your openSUSE computer? My blog talks about how to setup such a share and as far as I know, Samba does impart the fact a file is in use, but Samba can be misconfiguration in all sorts of ways it would seem.
> The filesystem being used is EXT4. The rest of your questions are…
> how should i put it… TOO technical for me at the moment
I guess he asks for the filesystem where the file is. As it is an XP
machine, it would be FAT or NTFS, exported via windows services, and
imported on Linux via samba.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
Normally, for files that exist on openSUSE, for which you want to share with Windows, I use FAT32 or NTFS partition type though openSUSE will not create a NTFS partition for you, it must be made with Windows or GParted. I mount them to a folder I create as root that gives everyone rights to the folder (such as “sudo chmod +777 /Windows”) and for FAT32 or NTFS, uses the fstab option of defaults. The least issue can be at fault and you need to use them all to make sure it works. The bash script I pointed you to has a feature that automatically (Almost) does everything for you with one selection including setting up the firewall. You DO NEED to create a Samba user on the openSUSE PC to share things from openSUSE back over to a Windows PC. The article you point to, does mention my user name here as determining that SWAT is no longer an option in openSUSE. I suggest you at least look at the bash script I have put together to get more help.
I guess he asks for the filesystem where the file is. As it is an XP
machine, it would be FAT or NTFS, exported via windows services, and
imported on Linux via samba.