Missing files - how to determine if it's APFS?

I’m getting reports of files ‘going missing’
I’ve added loads of sanity checks…

Making backup of an overridden file.
after saving, is the file there?
does it have a length?

Yet people report the file is missing or has mysteriously reverted to an earlier version , on a later session.

So, my Prime suspect is ADFS and High Sierra.
Is there a system call or MBS Plugin function I can use to determine which filing system is in use?

Way not enough information. What are “missing files”? What are the symptoms of your missing files? Crashes, NOEs? Do your users have case-sensitive file systems? And no the new file system shouldn’t make any difference at all.

PS: It’s either ADHS or AFPS. One is a symptom of our times and the other is the file system

Im not really asking for help finding the missing files. :slight_smile:
I’d be easily convinced that people are saving them in some location and forgetting where they saved them, but the handful of customers who reported this are credible.
These are just the files that my app saves.
A binary file format saved as a chunk of data to disc with a custom extension.

Literally no symptoms at all.
No exceptions logged, no messageboxes raised.
All internal ‘did this save OK’ tests passed.
Then ‘some time later’, customer cannot find the file.

I’d heard otherwise. Very slow writing compared to HFS and ‘loss of data’

I confirm I had to revert to HFS after wasting a bunch of time on a 10K file save that took over 4 seconds on an SSD under APFS and only 64 or 65 milliseconds on a regular hard drive.

That said, I have no report yet of missing files.

using the command line diskutil list and filtering the result,
you are able to detect the format system of the volume you are writing to.

Not a surprise.
I have only 3 or 4 such reports, but literally thousands of installed copies, of which at least hundreds will be running High Sierra.
The issue is trying to find a common factor.

Here’s how to retrieve the file system name of a volume:

[code]Function FileSystemName(extends f as FolderItem) As String
#if TargetMacOS
declare function statfs lib “System” (path as CString, ByRef dataOut as statfs_t) as Integer
dim info as statfs_t
if statfs (f.NativePath, info) = 0 then
return info.fstypename.DefineEncoding(Encodings.ASCII)
end if
End Function

Structure statfs_t
otype as int16
oflags as int16
bsize as int32
iosize as int32
blocks as int32
bfree as int32
bavail as int32
files as int32
ffree as int32
fsid as int64
owner as int32
res1 as int16
type as int16
flags as int32
res2 as int64
fstypename as String15
mntonname as String
mntfromname as String*90
res3(0) as byte
res4 as int32
res5 as int32
res6 as int32
res7 as int32
End Structure // should be 272 bytes[/code]

[quote=379021:@Jeff Tullin]Not a surprise.
I have only 3 or 4 such reports, but literally thousands of installed copies, of which at least hundreds will be running High Sierra.
The issue is trying to find a common factor.[/quote]
does the affected computers run on ssd or mechanical hard drives ?

Just a few thoughts on this:

This would seem to be a decent clue that we shouldn’t overlook.

Are they saving to a Dropbox folder or other cloud system?

To double-check their sanity when they report the issue, you could ask them to use Spotlight to search for the filename, in case they are accidentally saving the file in two different locations.

I would add some over-the-top logging while you resolve the issue - log every time they save, where they save and, after a save, you could run a Timer that simply checks the existence of the file every few minutes and logs the result.

I had something really weird happen with the latest 10.13.4 beta - one file was replaced with random garbage: https://forum.xojo.com/46369-10-13-4-beta-4-crash-with-project-images/

I’ve had one customer who’s reported such a problem, upgrading to High Sierra broke a bunch of applications (not just mine) on her computer and when I say broke, I mean the application package was missing files.

I don’t have any other statistics to say how many other customers I have that are running High Sierra which didn’t have this problem.

It’s good though; the more these problems show up and start to irritate our customers, the louder the noise will get. At first it’s handful of developers “whining”, then more and more developers complain, now with High Sierra and iOS 11, customers are loudly complaining. Cook either has to alter course to correct this stupid brain dead decision, or he doesn’t and the shareholders will oust him. I am hoping that Cook can learn from this mistake and correct the problem.

I do not use (and I just checked, just in case) APFS, but I feel I can suffer from something like that (El Capital, with all updates).

BUT I have no proofs of that feeling.

BTW: if you use BinaryStream or TextOutputStream, do you use the Flush command ?

Are-you able to reproduce the “bug” ?
(If so, try to Save as…)