its weird because i just tried and rebuilt another app ive done in cn1, it 
downloads pdfs to fileststemstorage, that work fine still

it uses 

 Util.downloadUrlToFileSystemInBackground(url, 
FileSystemStorage.getInstance().getAppHomePath()+savedFileName, new 
ActionListener(){
                @Override
                public void actionPerformed(ActionEvent evt) {
                    _("%%%%%%%%%%%%PDF download complete%%%%%%%%%%%%%%%");
                }
            }); 

On Wednesday, January 16, 2019 at 6:25:25 PM UTC+8, Gareth Murfin wrote:
>
> files dont even write on ios, im assuming this is a cn1 one bug by now. 
>
>  try
>         {
>             String root = FileSystemStorage.getInstance().getAppHomePath();
>             OutputStream os = 
> FileSystemStorage.getInstance().openOutputStream(root+"testfile.txt");
>             os.write("arse".getBytes());
>             _("arse written");
>             _("does it exist? 
> "+FileSystemStorage.getInstance().exists(root+"testfile.txt"));
>             
>         }
>         catch(Exception e)
>         {
>             _("cant write file "+e.getMessage());
>         }
>
> ####StateMachine arse written
>  ####StateMachine does it exist? false
>
> On Wednesday, January 16, 2019 at 3:58:41 PM UTC+8, Gareth Murfin wrote:
>>
>> thanks shai.. no luck unfortunately, i made sure there was no /// 
>>
>> but i still see 
>> Failed to create directory 
>> /var/mobile/Containers/Data/Application/4B8FF26A-77E4-473E-A4A8-4D2D6F119B26/Documents/com.outlier.lang/gaztest/testzipfolder/
>>
>> I even wrote a simple test to simply make a dir, but it always fails on 
>> iphone, it is as if you cannot make dirs on iphone at all.. but surely 
>> someone would have noticed by now... 
>>
>> this code 
>>
>>   FileSystemStorage fs = FileSystemStorage.getInstance();
>>         fs.mkdir("ZZZTESTA");
>>         fs.mkdir("ZZZTESTB");
>>         String testpath = fs.getAppHomePath()+"/xxxtesta";
>>         fs.mkdir(testpath);
>>          String testpathb = fs.getAppHomePath()+"xxxtestb";
>>         fs.mkdir(testpathb);
>>
>> results in 
>>
>>  Jan 16 15:53:15 USERs-iPhone MyApplication[2388] <Notice>: Failed to 
>> create directory ZZZTESTA
>>  Jan 16 15:53:15 USERs-iPhone MyApplication[2388] <Notice>: Failed to 
>> create directory ZZZTESTB
>>  Jan 16 15:53:15 USERs-iPhone MyApplication[2388] <Notice>: Failed to 
>> create directory 
>> /var/mobile/Containers/Data/Application/F0E3CD3E-F560-4E5A-987B-5A89CA79EB85/Documents/com.outlier.lang//xxxtesta
>>  Jan 16 15:53:15 USERs-iPhone MyApplication[2388] <Notice>: Failed to 
>> create directory 
>> /var/mobile/Containers/Data/Application/F0E3CD3E-F560-4E5A-987B-5A89CA79EB85/Documents/com.outlier.lang/xxxtestb
>>
>> completely ridiculous. 
>>
>> On Monday, January 14, 2019 at 11:21:29 AM UTC+8, Shai Almog wrote:
>>>
>>> Try:
>>>
>>> if(str_outdir.endsWith("/")) {
>>>     fs.mkdir(str_outdir + str_name);
>>> } else {
>>>     fs.mkdir(str_outdir + "/" + str_name);
>>> }
>>>
>>> Also check that str_name doesn't include / within it. You can test both 
>>> in the simulator but failure will probably only show on the device as it's 
>>> more sensitive to these nuances.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/ecb23868-522a-4a2b-ad94-a0dc65cfc73a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to