On Monday, April 18, 2016 at 3:53:44 PM UTC-4, Colin Law wrote:
>
> On 18 April 2016 at 19:07, fugee ohu
> wrote:
> > ...
> > how can changing to_path affect the value of from_path ?
>
> Because, as botp pointed out, they are referencing (pointing to) the
> same object
On Monday, April 18, 2016 at 12:13:37 PM UTC-4, bot Peña wrote:
>
> On Mon, Apr 18, 2016 at 10:50 PM, fugee ohu > wrote:
> > def move_file
> > from_path=params[:file_name]
> > to_path=params[:file_name]
> > to_path["queue/"]=""
> > FileUtils.mv
On Monday, April 18, 2016 at 3:53:44 PM UTC-4, Colin Law wrote:
>
> On 18 April 2016 at 19:07, fugee ohu
> wrote:
> > ...
> > how can changing to_path affect the value of from_path ?
>
> Because, as botp pointed out, they are referencing (pointing to) the
> same object
On 18 April 2016 at 19:07, fugee ohu wrote:
> ...
> how can changing to_path affect the value of from_path ?
Because, as botp pointed out, they are referencing (pointing to) the
same object in memory.
Use
to_path = some function of params[]
to avoid the problem. In a
On Monday, April 18, 2016 at 11:32:07 AM UTC-4, Colin Law wrote:
>
> On 18 April 2016 at 15:50, fugee ohu
> wrote:
> > def move_file
> > from_path=params[:file_name]
> > to_path=params[:file_name]
> > to_path["queue/"]=""
>
> Have you put a debug print in
On Monday, April 18, 2016 at 11:32:07 AM UTC-4, Colin Law wrote:
>
> On 18 April 2016 at 15:50, fugee ohu
> wrote:
> > def move_file
> > from_path=params[:file_name]
> > to_path=params[:file_name]
> > to_path["queue/"]=""
>
> Have you put a debug print in
On Monday, April 18, 2016 at 12:13:37 PM UTC-4, bot Peña wrote:
>
> On Mon, Apr 18, 2016 at 10:50 PM, fugee ohu > wrote:
> > def move_file
> > from_path=params[:file_name]
> > to_path=params[:file_name]
> > to_path["queue/"]=""
> > FileUtils.mv
On Mon, Apr 18, 2016 at 10:50 PM, fugee ohu wrote:
> def move_file
> from_path=params[:file_name]
> to_path=params[:file_name]
> to_path["queue/"]=""
> FileUtils.mv "#{from_path}", "#{to_path}"
> redirect_to request.referrer
> end
>
params[:file_name],
On 18 April 2016 at 15:50, fugee ohu wrote:
> def move_file
> from_path=params[:file_name]
> to_path=params[:file_name]
> to_path["queue/"]=""
Have you put a debug print in to check what from_path and to_path are set to?
Colin
> FileUtils.mv
def move_file
from_path=params[:file_name]
to_path=params[:file_name]
to_path["queue/"]=""
FileUtils.mv "#{from_path}", "#{to_path}"
redirect_to request.referrer
end
request parameters:
{"file_name"=>"recordings/WCR-20160409.mp3",
"file_type"=>"to_be_moved",
10 matches
Mail list logo