Author Topic: B5: MacOS File with read&write permission can be opened/edited but not saved  (Read 13915 times)

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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.
« Last Edit: October 08, 2014, 11:41:55 AM by Clark »

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
/Users/tuchman/space dir/space file.txt can be read, but not written.

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
I can't reproduce this.

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
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

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
What utility did you use to dump your disk info? Disk Utility doesn't show the same info.

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
About This Mac => More Info... => System Report => Hardware => Storage

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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.

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
Tried that a few weeks ago...
"Sorry - same SE behavior after trying both "<path>vs -sc /tmp/config1" and "vs -sul". "

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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
« Last Edit: October 20, 2014, 01:50:00 AM by Clark »

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
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?

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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.
« Last Edit: October 20, 2014, 08:40:49 PM by Clark »

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
"save +o" also failed, same error dialog raised.
The file contents on disk did not change.

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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.

tuchman

  • Senior Community Member
  • Posts: 144
  • Hero Points: 7
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.

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
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.