"\" and "/" changing in file names in windows.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

"\" and "/" changing in file names in windows.

Post by Tribblehunter »

Having a liitle issue with file names in windows 8

on one run of the livecode app i have built the filename of the file has "/" in the title.

on other runs it has "\" in the title.

Anyone else had this issue?
Returning to try to learn livecode again.

But much greyer at the temples than the last time.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: "\" and "/" changing in file names in windows.

Post by FourthWorld »

LiveCode uses the standard Unix convention internally. Under what circumstances were you seeing Windows paths?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: "\" and "/" changing in file names in windows.

Post by Tribblehunter »

Hi.

Code: Select all

get the mainStack of me
   put the filename of stack it into tFilename
Filename had "/" as seperator, but then code failed and it had changed to "\".

It is an autosave stack which I add to my mainstacks which saves the file every 600 seconds under a new name using time and date reference

Code: Select all

   set itemdelimiter to "/"
   delete last item of tFileName
   put it into tVersion
   put "/"& tVersion&& tDate2&tTime&".livecode" after tFileName 
   save stack tVersion as tFileName
Returning to try to learn livecode again.

But much greyer at the temples than the last time.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: "\" and "/" changing in file names in windows.

Post by FourthWorld »

Tribblehunter wrote:Filename had "/" as seperator, but then code failed and it had changed to "\".
What is the recipe to reproduce this failure?

I've never seen LiveCode use anything but Unix paths in the 17 years I've been using it, but perhaps this is a recent regression. The code needed to reproduce the issue along with the version number of the LiveCode engine in which this fails will allow the team to fix this quickly.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: "\" and "/" changing in file names in windows.

Post by Klaus »

Quick shot:
You are using the variable tDate2 in your script, does it hold an ENGLISH date?
That will have SLASHES in it and maybe LC tries to ESCAPE these in the filename when saving to disk?
Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: "\" and "/" changing in file names in windows.

Post by Tribblehunter »

Hi all.

Trying to recreate the glitch. Will post details when it occurs again. If at all.
Returning to try to learn livecode again.

But much greyer at the temples than the last time.
Post Reply