Welcome, Guest. Please Login or Register
FET Homepage
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Same file modified by two users (Read 143 times)
Andrés Chandía
Junior Member
**
Offline


Free Software for everybody!

Posts: 50
Barcelona, but chilean
Gender: male
Same file modified by two users
07/19/10 at 08:59:56
 
We have managed to put the fet files at a samba server, so the same files can be edited by a group of persons, the thing is that now we are looking for an option that allows you to see the file if somebody else is using it but without possibilities of editing it while in process by somebody else. Is there a way to do this?
Thanks for helping.
Back to top
 

@ch
WWW Andrés Chandía  
IP Logged
 
Liviu Lalescu
YaBB Administrator
*****
Offline


FET author and forum admin

Posts: 1569
Craiova, Romania
Gender: male
Re: Same file modified by two users
Reply #1 - 07/20/10 at 06:48:08
 
Maybe you can do that: when a person opens the .fet file (first person), create a "name_of_file.locked". When the person closes the .fet file, remove that .locked file. Another person can open the .fet file, but cannot save if there exists a .locked file.

One problem: 1st user opens .fet file (F_Version_1), 2nd user opens .fet file, 1st user modifies, saves, closes, now 2nd user does a minor change (to the original file, F_Version_1), saves. The 1st user's modifications are lost. So maybe change above method, so that if second user opens file and .locked exists, he cannot save the file until he opens it again.

This can be implemented easily in FET, I can tell you where (in src/engine/rules.cpp, function read (line 5133) and function write (line 7019), maybe alternatively in src/interface/fetmainform.cpp, function on_fileOpenAction_activated (line 784) and function fileSaveAs (line 866)).

Edited to add: and function fileSave (fetmainform.cpp, line 1284).
Back to top
 
 
IP Logged
 
Andrés Chandía
Junior Member
**
Offline


Free Software for everybody!

Posts: 50
Barcelona, but chilean
Gender: male
Re: Same file modified by two users
Reply #2 - 07/20/10 at 07:27:37
 
Thanks again,
I will try it, to do it on windows installations, how should I proceed, I mean, should I do all of the changes once fet is installed or before,  and if it's before, how?
Back to top
 

@ch
WWW Andrés Chandía  
IP Logged
 
Liviu Lalescu
YaBB Administrator
*****
Offline


FET author and forum admin

Posts: 1569
Craiova, Romania
Gender: male
Re: Same file modified by two users
Reply #3 - 07/20/10 at 07:33:16
 
Andrés Chandía wrote on 07/20/10 at 07:27:37:
Thanks again,
I will try it, to do it on windows installations, how should I proceed, I mean, should I do all of the changes once fet is installed or before,  and if it's before, how?


I do not understand. Of course you need to change the sources of FET, compile and install (that is the order).

What do you mean by: "if it's before, how?"?
Back to top
 
 
IP Logged
 
Andrés Chandía
Junior Member
**
Offline


Free Software for everybody!

Posts: 50
Barcelona, but chilean
Gender: male
Re: Same file modified by two users
Reply #4 - 07/20/10 at 07:43:45
 
the thing is, in windows you download the zipped file, you expand it and you use it, no installation, that is the question related to.
Back to top
 

@ch
WWW Andrés Chandía  
IP Logged
 
Liviu Lalescu
YaBB Administrator
*****
Offline


FET author and forum admin

Posts: 1569
Craiova, Romania
Gender: male
Re: Same file modified by two users
Reply #5 - 07/20/10 at 07:52:56
 
Andrés Chandía wrote on 07/20/10 at 07:43:45:
the thing is, in windows you download the zipped file, you expand it and you use it, no installation, that is the question related to.


Unpack fet-v.v.v.exe. You obtain the directory fet-v.v.v. In this directory, you can keep all the files, without fet.exe. You need to obtain a new fet.exe by compiling from sources, then overwrite your custom fet.exe over official fet.exe. Then, you have the whole directory and you can archive it, make it a self extracting archive, as you wish.

Or, you can get the sources (tar.bz2) FET, unpack, modify the sources as I told you, compile, eventually remove the src and tmp directories and files Makefile and fet.pro - then you obtain the same structure as above, containing the new fet.exe (so, no need to care about other details). Make it an archive, as above (the important and different from official archive is only fet.exe, which you obtain after compiling).

To compile, you need to get Qt and MinGW (or other C++ compiler), and follow the other advice in FET README. Modify the .cpp files, as I told you. Then compile. After compilation, you will get a new fet.exe file - this is the only file different from the official files.

Let me know if it is clear now.
Back to top
 
 
IP Logged
 
Andrés Chandía
Junior Member
**
Offline


Free Software for everybody!

Posts: 50
Barcelona, but chilean
Gender: male
Re: Same file modified by two users
Reply #6 - 07/20/10 at 07:57:48
 
Ok, so I can do the whole compiling process in linux and then install fet on windows?
Back to top
 

@ch
WWW Andrés Chandía  
IP Logged
 
Liviu Lalescu
YaBB Administrator
*****
Offline


FET author and forum admin

Posts: 1569
Craiova, Romania
Gender: male
Re: Same file modified by two users
Reply #7 - 07/20/10 at 08:04:38
 
Andrés Chandía wrote on 07/20/10 at 07:57:48:
Ok, so I can do the whole compiling process in linux and then install fet on windows?


Oh, no Smiley . How can you run a GNU/Linux program under Windows?

You can modify FET sources under GNU/Linux, test them, then copy them under Windows and compile under Windows (using MinGW or MSVC, with Qt for Windows installed).

There may be other possibility: get mingw32 (with qt) libraries under GNU/Linux and do a cross-compile. I once managed to obtain the fet.exe like that, but it didn't run under Windows, it complained about missing .dll-s. Also, installation of cross-compile mingw32 under GNU/Linux is difficult, and you need to change some things, and compilation is also difficult.
Back to top
 
 
IP Logged
 
Andrés Chandía
Junior Member
**
Offline


Free Software for everybody!

Posts: 50
Barcelona, but chilean
Gender: male
Re: Same file modified by two users
Reply #8 - 07/20/10 at 08:11:41
 
Ok, got you.
Back to top
 

@ch
WWW Andrés Chandía  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print