SlickEdit Community

Archived Read Only Forums => SlickEdit 2014 v19 beta => Topic started by: tuchman on September 18, 2014, 06:16:57 am

Title: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on September 18, 2014, 06:16:57 am
OS: Mac OS X Mavericks, OS Version: 10.9.4
I drag a file from the Double Commander application to SE.
File opens and allows edits as expected.
On file save, SE raises an error dialog indicating that file can not be found.
Open same file using SE's File Open, and the write works fine.
I noticed the same behavior on B4, but I assumed that it was me.
Thanks,
-ken
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on September 18, 2014, 01:21:53 pm
I installed Double Commander on Mavericks. I'm not able to do any drag/drop outside of Double Commander. How do you drag/drop a file from Double Commander to another application?
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on September 19, 2014, 04:11:30 am
I didn't do anything special to enable DaD on DC.
Hold left (Logitech) mouse button => drag => release.
Maybe the attached screen recording will shed some light on the problem.

BTW: While resizing SE windows to make the recording, I somehow managed to restore a more "legacy" file tab look. This tab behaves much better than the tab bar that I was using before. I hope it stays this way.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on September 19, 2014, 01:32:17 pm
I don't have acces to a Mac (or computer) this weekend and my ipad won't play the file you posted. What version of double commander are you using? Either I downloaded the wrong app or it's a different version.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on September 20, 2014, 03:48:02 am
I'm using Double Commander 0.5.10 beta   2014-05-12,
http://sourceforge.net/projects/doublecmd/files/DC%20for%20Mac%20OS%20X%2064%20bit/Double%20Commander%200.5.10%20beta/ (http://sourceforge.net/projects/doublecmd/files/DC%20for%20Mac%20OS%20X%2064%20bit/Double%20Commander%200.5.10%20beta/)
BTW: Should you locate a PC to use, Media Player Classic 1.7.6.234 (941fe29) plays it fine on Windows.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Sandra on September 25, 2014, 02:12:46 pm
Are you able to reproduce this issue on a clean configuration? 
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on September 26, 2014, 03:31:19 am
Please define "clean configuration".
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on September 26, 2014, 10:38:32 am
Invoke SlickEdit with the -sc option ("<path>vs -sc /tmp/config1").

I'm look into a different bug we found while trying to reproduce this. It's possible these problems are related but at the moment I can't tell.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on September 27, 2014, 02:25:55 pm
Try invoking SlickEdit with the -sul option ("vs -sul").  If this fixes your problem, then the bug I just fixed will also fix this problem.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on September 29, 2014, 04:04:30 am
Sorry - same SE behavior after trying both "<path>vs -sc /tmp/config1" and "vs -sul".
Also when using the newest DC beta version 0.5.11.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 03, 2014, 06:00:47 pm
I have not been able to reproduce this problem in B6 - thanks!
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 07, 2014, 11:37:20 am
Sorry - Just reproduced the problem on B6.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 07, 2014, 11:44:32 am
Please see screen shot.
Looks like the full path with space is no problem for reading, but is a problem for writing.
All files in the recent file list are located in the same directory.
Not OK: /Volumes/Macintosh HD/Users/tuchman/CrashInspect/CrashInspect.app/Contents/Resources/notes.txt
OK: /Users/tuchman/CrashInspect/CrashInspect.app/Contents/Resources/notes.txt
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 07, 2014, 05:17:46 pm
Do you have the same problem with files names with spaces that aren't on mounted file systems?
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 08, 2014, 03:47:00 am
Sorry - don't understand the question.
How can a file be accessed on a file system that isn't mounted?
In any case, SE exhibited the same problem with the file:
/Users/tuchman/space dir/space file.txt
Any specific tests I should perform?
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 08, 2014, 11:38:34 am
Bad question.

Can you read/write files that are under /Users/tuchman when they have spaces?

I'm wondering if the problem is limited to a specific file system mounted in a specific way or if the problem has to do with file names with spaces.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 09, 2014, 03:44:33 am
/Users/tuchman/space dir/space file.txt can be read, but not written.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 09, 2014, 10:14:01 pm
I can't reproduce this.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 10, 2014, 03:28:23 am
I finally had the time to explore the "spaces problem" on different file systems...
Both Read & Write are possible on a USB drive with ExtFAT
Only Read is possible on internal SSD with Journaled HFS+

Macintosh HD:
  Available:   62,92 GB (62.922.452.992 bytes)
  Capacity:   120,14 GB (120.137.519.104 bytes)
  Mount Point:   /
  File System:   Journaled HFS+
  Writable:   Yes
  Ignore Ownership:   No
  BSD Name:   disk1
  Volume UUID:   0B18B190-85E0-3A46-A97E-DA0E564A25EE
  Logical Volume:
  Revertible:   Yes (unlock and decryption required)
  Encrypted:   Yes
  Encryption Type:   AES-XTS
  Locked:   No
  LV UUID:   4E3F794E-7079-453B-B204-2FEF27E18EC9
  Logical Volume Group:
  Name:   Macintosh HD
  Size:   120,47 GB (120.473.067.520 bytes)
  Free Space:   16,8 MB (16.777.216 bytes)
  LVG UUID:   11962A52-5676-42B0-8F77-1C542EC3C975
  Physical Volumes:
disk0s2:
  Media Name:   APPLE SSD TS0128F Media
  Size:   120,47 GB (120.473.067.520 bytes)
  Medium Type:   SSD
  Protocol:   PCI
  Internal:   Yes
  Partition Map Type:   GPT (GUID Partition Table)
  Status:   Online
  S.M.A.R.T. Status:   Verified
  PV UUID:   58773313-7075-45A3-830E-9A5F164D6DDC
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 13, 2014, 02:57:30 pm
What utility did you use to dump your disk info? Disk Utility doesn't show the same info.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 14, 2014, 06:03:09 am
About This Mac => More Info... => System Report => Hardware => Storage
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 17, 2014, 03:08:47 pm
Still no luck reproducing this. All drives we have are "Journaled HFS+". Some are SSDs and some are not.  I noticed you have encryption on so I tried adding an encrypted drive to a Mac VM but still no luck.

Historically, all filename with spaces problems have had nothing to do with hardware or file system. It's very odd that it works on some file systems and not on others.

Have you tried a default config? (vs -sc /tmp/tmpconfig). It's a long shot but I had to ask.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 18, 2014, 09:07:18 am
Tried that a few weeks ago...
"Sorry - same SE behavior after trying both "<path>vs -sc /tmp/config1" and "vs -sul". "
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 19, 2014, 05:33:29 pm
I wrote a couple tests programs for you to try:

vs-save-test1 <filename>
vs-save-test2 <filename> -- source code provided

Please run both if test1 fails.

Both these test programs read the entire contents of the file given into memory and then write it out.

It will be interesting to see if either of these test programs work on this file system.

Just download this: http://support.slickedit.com/Outbound/vs-save-tests-mac.zip (http://support.slickedit.com/Outbound/vs-save-tests-mac.zip)
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 20, 2014, 03:56:42 am
Test results:
tuchman-mac01:SE_test tuchman$ ./vs-save-test1 "/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt"
save succedded
tuchman-mac01:SE_test tuchman$ ./vs-save-test2 "/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt"
save succeded
tuchman-mac01:SE_test tuchman$

Trying to save same file in SE:
Unable to save
/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt
to
"/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt"
File not found.

Is quoting somehow related to this issue?
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 20, 2014, 01:50:56 pm
The double quotes around the file appear to be normal for this case.

Try executing "save +o" on the SlickEdit command line to save the file.

The +o option turns off backup. It doesn't turn off the save logging though.

If the above command fails, check if the contents of the file changed on disk.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 21, 2014, 04:17:55 am
"save +o" also failed, same error dialog raised.
The file contents on disk did not change.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 21, 2014, 02:25:18 pm
Here's a very small Slick-C batch macro I would like you to run. It removes some of the complexities of the "save" command and just calls the raw _save_file() function with the "+o" option.

To run this macro, type "xcom <path>test4.e" on the SlickEdit command and it will save the current file. The status results will be displayed in a debug window.

Download the attachment. Put it in any directory with read/write permissions since SlickEdit will attempt to compile it (write test4.ex) the first time you run it.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 22, 2014, 03:53:04 am
After executing "xcom  /Users/tuchman/Downloads/test4.e", a debug window was raised containing:
"0 save failed: File not found".  I repeated the command 2 times (the window lost focus, which confused me a bit), and observed:
"1 save failed: File not found".
"2 save failed: File not found".
File contents on disk were not changed.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 22, 2014, 12:05:13 pm
Thanks. This issue is turning out to be a tricky one.

I'm surprised that the stand alone test program (vs-save-test1) worked but the built-in _save_file() does not.

We will have to put trace code in the _save_file() built-in. That way, you can specify something like ("save +x +o") and get a debug window with output. This trace code will indicate more precisely where it is failing. The only guess I have is that the open call is failing. However, that doesn't explain why "vs-save-test1" can open the file for writing but _save_file() can't with exactly the same code.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 22, 2014, 02:31:18 pm
I've got another idea.

Execute "save -a +o" from the SlickEdit command line to save your file. The "-a" option turns off a call which resolves symbolic links. Given all the information you have given me, this is the only difference between the "vs-save-test1" program and the _save_file() built-in that would make sense.

If you have any symbolic links in "/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt", please post the path parts and the link/redirection values.

Thanks
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: tuchman on October 23, 2014, 02:58:29 am
After issuing "save -a +o":
1) The data is saved to file, no error dialog is raised.
2) The filename on the tab remains starred!
3) After selecting another tab, then returning to tab with test file, SE raises the "Reload Modifies Files" dialog showing the path "/Volumes/Macintosh HD/Users/tuchman/temp/with spaces/space notes.txt", but the test file is unchecked.
4) After checking and hitting reload, the star on the tab is gone

Issuing "ls -lR "/Users/tuchman/temp" returns nothing.
Issuing "ls -l "/Volumes/Macintosh HD" returns "/"
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Clark on October 23, 2014, 12:50:20 pm
Now we're getting somewhere.

We are converting the filename to "/Users/tuckman/temp/with spaces/space notes.txt". That's why it can't be found when the symbolic link is resolved.

We will have to figure out some sort of work around for this weird symbol link.
Title: Re: B5: MacOS File with read&write permission can be opened/edited but not saved
Post by: Dennis on October 24, 2014, 11:08:50 pm
Fixed.  Thanks for all the diligent feedback helping us track this one down!