Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

moving files that are being used / code stuff

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  

Am i making sense? and could this be usefull?
make it more clear so others can understand
0%
 0%  [ 0 ]
yeah, it can be usefull. But don't use fuse
0%
 0%  [ 0 ]
Useless, waste of time / aready available
0%
 0%  [ 0 ]
see how it goes / i'll help
0%
 0%  [ 0 ]
You don't understand anything about filesystems
0%
 0%  [ 0 ]
Total Votes : 0

Author Message
chan_0x0c



Joined: Wed Nov 15, 2006 10:11 am
Posts: 3

PostPosted: Wed Nov 15, 2006 11:07 am    Post subject: moving files that are being used / code stuff Reply with quote

In a nutshell, I want to move the location where the file resides,
while it's being used by another process.

Before I proceed to actual codeing, I would like any feed back to make sure
I'm not 're-inventing-the-wheel'.

Any comments, rangeing from
I know something called <insert code base/app name here> that does what you want to do ...
or
you know, your idea's good/bad, but it won't happen...etc, etc
to
You dumb #*$@%, it's aredy in <stuff here> ,
is all greatly appreceated.

Since a quick web search didn't turn up what i wanted, I intend to have something like this.

Moving a file, or a mount point is not really possible, if the file that resides in there
is being used by a another process.
And I do not have the option of killing off the process using the file.
There are genuine situations and reasons where you
are required to keep the process alive.
dynamically moving the filesystem when the space is short is one,
While still keeping the system alive.
And although there is XEN, or user mode linux, that's not really
generic in this case, as I don't really want/need the 'migrate the system' thing.
just a ability to move a sub directory is fine, as long as its cheap (in resource terms)
I wish i can change the phycal disk that the file resides, while the file is being used.

something like (pusudocode)

/*when reading*/
if( file_size_limited_or_not_stream_or_any_special_file ){
copy (file_from_here , now_location_of_file_there);
flag_file_migration_ready = true;
/*fuse_get_context() stuff to clean up*/
/*mmap() and dup() problems, haven't really thought about a solution yet */
/*we'l manage somehow*/
}else{/*havent thought about yet*/}

/* elsewhere in the code, overwriting the read method */
return int read( pointer){
if(flag_file_migration_ready){
return read( new_file_location, pointer)
}else{
return read( old_file_location, pointer)
}
}

that's just for ro file, and i haven't thought really deap about mem map or read/write.
there's also the primission thing, but we'll see how it turns out.
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast